From 0d1e8b82af5ef4bfa7ce4dc5c1d8ecd6e90da2b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Tue, 23 Nov 2021 07:32:31 +0100 Subject: [PATCH] Refactor Cypress tests for social media --- .../UserProfile.SocialMedia/I_add_a_social_media_link.js | 9 ++++++--- .../I_have_added_a_social_media_link.js | 7 +++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/cypress/integration/UserProfile.SocialMedia/I_add_a_social_media_link.js b/cypress/integration/UserProfile.SocialMedia/I_add_a_social_media_link.js index 9253709f9..ca2e36818 100644 --- a/cypress/integration/UserProfile.SocialMedia/I_add_a_social_media_link.js +++ b/cypress/integration/UserProfile.SocialMedia/I_add_a_social_media_link.js @@ -1,9 +1,12 @@ import { When } from "cypress-cucumber-preprocessor/steps"; When('I add a social media link', () => { - cy.get('input#addSocialMedia') - .type('https://freeradical.zone/peter-pan') - .get('button') + cy.get('button') .contains('Add link') .click() + .get('#editSocialMedia') + .type('https://freeradical.zone/peter-pan') + .get('button') + .contains('Save') + .click() }) \ No newline at end of file diff --git a/cypress/integration/UserProfile.SocialMedia/I_have_added_a_social_media_link.js b/cypress/integration/UserProfile.SocialMedia/I_have_added_a_social_media_link.js index 203b97032..93e35bf28 100644 --- a/cypress/integration/UserProfile.SocialMedia/I_have_added_a_social_media_link.js +++ b/cypress/integration/UserProfile.SocialMedia/I_have_added_a_social_media_link.js @@ -2,9 +2,12 @@ import { Given } from "cypress-cucumber-preprocessor/steps"; Given('I have added a social media link', () => { cy.visit('/settings/my-social-media') - .get('input#addSocialMedia') - .type('https://freeradical.zone/peter-pan') .get('button') .contains('Add link') .click() + .get('#editSocialMedia') + .type('https://freeradical.zone/peter-pan') + .get('button') + .contains('Save') + .click() }) \ No newline at end of file