From 24706e693fbcdc2a942020205362a407e762048e Mon Sep 17 00:00:00 2001 From: amtryingmybest Date: Fri, 23 Aug 2024 09:49:56 +0200 Subject: [PATCH 01/16] unskip skipped tests --- e2e-testing/cypress/e2e/6-posts/posts.cy.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/e2e-testing/cypress/e2e/6-posts/posts.cy.js b/e2e-testing/cypress/e2e/6-posts/posts.cy.js index 610ee1ec90..b1d4fee9b9 100644 --- a/e2e-testing/cypress/e2e/6-posts/posts.cy.js +++ b/e2e-testing/cypress/e2e/6-posts/posts.cy.js @@ -17,7 +17,7 @@ describe('Automated Tests for Posts', () => { postFunctions.verify_created_post_exists(); }); - it.skip('Verifies post details', () => { + it('Verifies post details', () => { postFunctions.open_post_for_details(); postFunctions.verify_post_details(); }); @@ -27,7 +27,7 @@ describe('Automated Tests for Posts', () => { postFunctions.complete_add_post_steps(); postFunctions.change_post_status(); }); - it.skip('Deletes a post', () => { + it('Deletes a post', () => { postFunctions.delete_post(); }); }); From fe9182d7671cbf5252079712e35fc5390a48e620 Mon Sep 17 00:00:00 2001 From: amtryingmybest Date: Fri, 23 Aug 2024 14:44:55 +0200 Subject: [PATCH 02/16] force clicking on post --- e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js b/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js index 45ad2435a3..a46af97d91 100644 --- a/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js +++ b/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js @@ -72,7 +72,7 @@ class PostFunctions { cy.get(DataViewLocators.revealFiltersBtn).click(); cy.get(DataViewLocators.clearFiltersBtn).click(); - cy.get(PostLocators.postItem).eq(0).click(); + cy.get(PostLocators.postItem).eq(0).click({ force: true }); } verify_post_details() { From 5cbbc3ab4c4a5c5eaee2cf400ba2736397468238 Mon Sep 17 00:00:00 2001 From: amtryingmybest Date: Thu, 29 Aug 2024 13:32:17 +0300 Subject: [PATCH 03/16] create and verify post within same function --- e2e-testing/cypress/e2e/6-posts/posts.cy.js | 4 +++- e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/e2e-testing/cypress/e2e/6-posts/posts.cy.js b/e2e-testing/cypress/e2e/6-posts/posts.cy.js index b1d4fee9b9..4289252e4e 100644 --- a/e2e-testing/cypress/e2e/6-posts/posts.cy.js +++ b/e2e-testing/cypress/e2e/6-posts/posts.cy.js @@ -15,12 +15,14 @@ describe('Automated Tests for Posts', () => { postFunctions.fill_required_form_fields(); postFunctions.complete_add_post_steps(); postFunctions.verify_created_post_exists(); + postFunctions.verify_post_details(); }); - it('Verifies post details', () => { + it.skip('Verifies post details', () => { postFunctions.open_post_for_details(); postFunctions.verify_post_details(); }); + it('Changes and verifies status of a post', () => { postFunctions.open_post_creation_form(); postFunctions.fill_required_form_fields(); diff --git a/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js b/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js index a46af97d91..1474c023b7 100644 --- a/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js +++ b/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js @@ -63,7 +63,8 @@ class PostFunctions { cy.get(PostLocators.postPreview) .children(PostLocators.postItem) .contains(this.postTitle) - .should('be.visible'); + .should('be.visible') + .click(); } open_post_for_details() { From 12a1f297eab7a636c0422ef71d143d5554236498 Mon Sep 17 00:00:00 2001 From: amtryingmybest Date: Thu, 29 Aug 2024 14:43:14 +0300 Subject: [PATCH 04/16] scroll to bottom of page then check element exists --- e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js | 1 + 1 file changed, 1 insertion(+) diff --git a/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js b/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js index 1474c023b7..b566ff6b10 100644 --- a/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js +++ b/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js @@ -84,6 +84,7 @@ class PostFunctions { //verify survey fields cy.get(PostLocators.titleValue).should('contain', 'Automated Title Response'); cy.get(PostLocators.descriptionValue).should('contain', 'Automated Description Response'); + cy.get('.ng-star-inserted.post-list__scroll').scrollTo('bottom'); cy.contains('Automated Short text').scrollIntoView().should('be.visible'); cy.contains('This is an automated long text response').should('be.visible'); cy.contains(99.9).should('be.visible'); From 23a9c871caed5edc69fef7e27b0dd36ff3dc2a2e Mon Sep 17 00:00:00 2001 From: amtryingmybest Date: Thu, 29 Aug 2024 15:10:48 +0300 Subject: [PATCH 05/16] change how page is scrolled to bottom --- e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js b/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js index b566ff6b10..5aef0cf4a0 100644 --- a/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js +++ b/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js @@ -84,7 +84,7 @@ class PostFunctions { //verify survey fields cy.get(PostLocators.titleValue).should('contain', 'Automated Title Response'); cy.get(PostLocators.descriptionValue).should('contain', 'Automated Description Response'); - cy.get('.ng-star-inserted.post-list__scroll').scrollTo('bottom'); + cy.get('.ng-star-inserted').scrollTo('bottom'); cy.contains('Automated Short text').scrollIntoView().should('be.visible'); cy.contains('This is an automated long text response').should('be.visible'); cy.contains(99.9).should('be.visible'); From 30c044224d49166ceb3747f69dd3130d8dc2716d Mon Sep 17 00:00:00 2001 From: amtryingmybest Date: Thu, 29 Aug 2024 15:51:07 +0300 Subject: [PATCH 06/16] change how page is scrolled to bottom try2 --- e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js b/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js index 5aef0cf4a0..48f8263693 100644 --- a/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js +++ b/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js @@ -84,7 +84,7 @@ class PostFunctions { //verify survey fields cy.get(PostLocators.titleValue).should('contain', 'Automated Title Response'); cy.get(PostLocators.descriptionValue).should('contain', 'Automated Description Response'); - cy.get('.ng-star-inserted').scrollTo('bottom'); + cy.get('.ng-star-inserted post-list__scroll > .post post--feed').scrollTo('bottom'); cy.contains('Automated Short text').scrollIntoView().should('be.visible'); cy.contains('This is an automated long text response').should('be.visible'); cy.contains(99.9).should('be.visible'); From 3554f586344b75eb8394afb542a96ba2aa3358c0 Mon Sep 17 00:00:00 2001 From: amtryingmybest Date: Thu, 29 Aug 2024 16:11:35 +0300 Subject: [PATCH 07/16] change how page is scrolled to bottom try3 --- e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js b/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js index 48f8263693..6346ff5105 100644 --- a/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js +++ b/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js @@ -84,7 +84,7 @@ class PostFunctions { //verify survey fields cy.get(PostLocators.titleValue).should('contain', 'Automated Title Response'); cy.get(PostLocators.descriptionValue).should('contain', 'Automated Description Response'); - cy.get('.ng-star-inserted post-list__scroll > .post post--feed').scrollTo('bottom'); + cy.get('app-post-details.ng-star-inserted > .post').scrollTo('bottom'); cy.contains('Automated Short text').scrollIntoView().should('be.visible'); cy.contains('This is an automated long text response').should('be.visible'); cy.contains(99.9).should('be.visible'); From bf0dd23e6c978dbe3c5305929ec61fda88c42e74 Mon Sep 17 00:00:00 2001 From: amtryingmybest Date: Thu, 29 Aug 2024 16:32:35 +0300 Subject: [PATCH 08/16] change how page is scrolled to bottom try4 --- e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js b/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js index 6346ff5105..45d2048c3e 100644 --- a/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js +++ b/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js @@ -84,7 +84,7 @@ class PostFunctions { //verify survey fields cy.get(PostLocators.titleValue).should('contain', 'Automated Title Response'); cy.get(PostLocators.descriptionValue).should('contain', 'Automated Description Response'); - cy.get('app-post-details.ng-star-inserted > .post').scrollTo('bottom'); + cy.get('[data-qa="posts"] > :nth-child(2)').scrollTo('bottom'); cy.contains('Automated Short text').scrollIntoView().should('be.visible'); cy.contains('This is an automated long text response').should('be.visible'); cy.contains(99.9).should('be.visible'); From 396953d558c65a7beb4e4db63fb17f9fab8c365e Mon Sep 17 00:00:00 2001 From: amtryingmybest Date: Thu, 5 Sep 2024 10:48:16 +0300 Subject: [PATCH 09/16] skip verifying short text field --- e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js b/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js index 45d2048c3e..1a0403b05b 100644 --- a/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js +++ b/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js @@ -85,7 +85,7 @@ class PostFunctions { cy.get(PostLocators.titleValue).should('contain', 'Automated Title Response'); cy.get(PostLocators.descriptionValue).should('contain', 'Automated Description Response'); cy.get('[data-qa="posts"] > :nth-child(2)').scrollTo('bottom'); - cy.contains('Automated Short text').scrollIntoView().should('be.visible'); + // cy.contains('Automated Short text').scrollIntoView().should('be.visible'); cy.contains('This is an automated long text response').should('be.visible'); cy.contains(99.9).should('be.visible'); cy.contains(100).should('be.visible'); From 135776f05fa392fc2786ab5d4a55a05e3a5f3bee Mon Sep 17 00:00:00 2001 From: amtryingmybest Date: Thu, 5 Sep 2024 11:57:39 +0300 Subject: [PATCH 10/16] change post getting deleted --- .../cypress/functions/PostsFunctions/PostFunctions.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js b/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js index 1a0403b05b..e6a04a160a 100644 --- a/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js +++ b/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js @@ -101,10 +101,11 @@ class PostFunctions { cy.get(DataViewLocators.revealFiltersBtn).click(); cy.get(DataViewLocators.clearFiltersBtn).click(); - //select post + //verify post numbers to verify we are in correct post page cy.get('[data-qa="feed-page-results"]').contains('Current results: 20 / 518'); - cy.contains(this.postTitle).scrollIntoView(); - cy.contains(this.postTitle).click(); + + //change post to be deleted to "New Post Title for Location" + cy.contains('New Post Title for Location').click(); //delete post cy.get(PostLocators.postMenuDots).eq(0).click(); @@ -116,7 +117,7 @@ class PostFunctions { cy.get(PostLocators.postPreview) .children(PostLocators.postItem) .contains(this.postTitle) - .should('not.exist'); + .should('New Post Title for Location'); } change_post_status() { From 2834bc5d6ebc52657b06c96dc2750c4f0dc7d30e Mon Sep 17 00:00:00 2001 From: amtryingmybest Date: Thu, 5 Sep 2024 12:20:38 +0300 Subject: [PATCH 11/16] change post getting deleted --- .../cypress/functions/PostsFunctions/PostFunctions.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js b/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js index e6a04a160a..95a134a867 100644 --- a/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js +++ b/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js @@ -101,8 +101,9 @@ class PostFunctions { cy.get(DataViewLocators.revealFiltersBtn).click(); cy.get(DataViewLocators.clearFiltersBtn).click(); - //verify post numbers to verify we are in correct post page + //verify post count to verify we are in correct post page cy.get('[data-qa="feed-page-results"]').contains('Current results: 20 / 518'); + cy.contains(this.postTitle).scrollIntoView(); //change post to be deleted to "New Post Title for Location" cy.contains('New Post Title for Location').click(); @@ -116,8 +117,8 @@ class PostFunctions { //verify post is deleted and doesn't exist cy.get(PostLocators.postPreview) .children(PostLocators.postItem) - .contains(this.postTitle) - .should('New Post Title for Location'); + .contains('New Post Title for Location') + .should('not.exist'); } change_post_status() { From da289895d859497b6e4d4919fd20e38bf4208297 Mon Sep 17 00:00:00 2001 From: amtryingmybest Date: Thu, 5 Sep 2024 12:33:11 +0300 Subject: [PATCH 12/16] force:true :( --- e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js b/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js index 95a134a867..8a302cc2b4 100644 --- a/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js +++ b/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js @@ -106,7 +106,7 @@ class PostFunctions { cy.contains(this.postTitle).scrollIntoView(); //change post to be deleted to "New Post Title for Location" - cy.contains('New Post Title for Location').click(); + cy.contains('New Post Title for Location').click({ force: true }); //delete post cy.get(PostLocators.postMenuDots).eq(0).click(); From 63584b97fc0864f7b53bc3cfabac10d694f0b9e2 Mon Sep 17 00:00:00 2001 From: amtryingmybest Date: Thu, 5 Sep 2024 12:57:22 +0300 Subject: [PATCH 13/16] delete original post, but force --- e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js b/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js index 8a302cc2b4..47ad9264f9 100644 --- a/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js +++ b/e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js @@ -106,7 +106,7 @@ class PostFunctions { cy.contains(this.postTitle).scrollIntoView(); //change post to be deleted to "New Post Title for Location" - cy.contains('New Post Title for Location').click({ force: true }); + cy.contains(this.postTitle).click({ force: true }); //delete post cy.get(PostLocators.postMenuDots).eq(0).click(); @@ -117,7 +117,7 @@ class PostFunctions { //verify post is deleted and doesn't exist cy.get(PostLocators.postPreview) .children(PostLocators.postItem) - .contains('New Post Title for Location') + .contains(this.postTitle) .should('not.exist'); } From fd098a5e4c8f85a787dcc7ed1c1f79a30abfbf18 Mon Sep 17 00:00:00 2001 From: amtryingmybest Date: Thu, 5 Sep 2024 14:04:50 +0300 Subject: [PATCH 14/16] delete unused code that has been moved --- e2e-testing/cypress/e2e/6-posts/posts.cy.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/e2e-testing/cypress/e2e/6-posts/posts.cy.js b/e2e-testing/cypress/e2e/6-posts/posts.cy.js index 4289252e4e..1f916e7aaa 100644 --- a/e2e-testing/cypress/e2e/6-posts/posts.cy.js +++ b/e2e-testing/cypress/e2e/6-posts/posts.cy.js @@ -18,11 +18,6 @@ describe('Automated Tests for Posts', () => { postFunctions.verify_post_details(); }); - it.skip('Verifies post details', () => { - postFunctions.open_post_for_details(); - postFunctions.verify_post_details(); - }); - it('Changes and verifies status of a post', () => { postFunctions.open_post_creation_form(); postFunctions.fill_required_form_fields(); From 9a2238ae178a65f054b98fd4231e7be5687f6482 Mon Sep 17 00:00:00 2001 From: amtryingmybest Date: Mon, 16 Sep 2024 20:44:07 +0300 Subject: [PATCH 15/16] run tests From 0d03e420e7a02ddc59b3548ab0eb95c684ebb269 Mon Sep 17 00:00:00 2001 From: amtryingmybest Date: Mon, 16 Sep 2024 21:27:33 +0300 Subject: [PATCH 16/16] run tests