Skip to content

Commit

Permalink
E2e bring back skipped tests (#1363)
Browse files Browse the repository at this point in the history
* unskip skipped tests

* force clicking on post

* create and verify post within same function

* scroll to bottom of page then check element exists

* change how page is scrolled to bottom

* change how page is scrolled to bottom try2

* change how page is scrolled to bottom try3

* change how page is scrolled to bottom try4

* skip verifying short text field

* change post getting deleted

* change post getting deleted

* force:true :(

* delete original post, but force

* delete unused code that has been moved

* run tests

* run tests

---------

Co-authored-by: amtryingmybest <wobadha@gmail.com>
  • Loading branch information
AmTryingMyBest and Obadha committed Sep 16, 2024
1 parent 556b903 commit 29faca6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
7 changes: 2 additions & 5 deletions e2e-testing/cypress/e2e/6-posts/posts.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,16 @@ describe('Automated Tests for Posts', () => {
postFunctions.fill_required_form_fields();
postFunctions.complete_add_post_steps();
postFunctions.verify_created_post_exists();
});

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();
postFunctions.complete_add_post_steps();
postFunctions.change_post_status();
});
it.skip('Deletes a post', () => {
it('Deletes a post', () => {
postFunctions.delete_post();
});
});
14 changes: 9 additions & 5 deletions e2e-testing/cypress/functions/PostsFunctions/PostFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -72,7 +73,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() {
Expand All @@ -83,7 +84,8 @@ class PostFunctions {
//verify survey fields
cy.get(PostLocators.titleValue).should('contain', 'Automated Title Response');
cy.get(PostLocators.descriptionValue).should('contain', 'Automated Description Response');
cy.contains('Automated Short text').scrollIntoView().should('be.visible');
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');
cy.contains(100).should('be.visible');
Expand All @@ -99,10 +101,12 @@ class PostFunctions {
cy.get(DataViewLocators.revealFiltersBtn).click();
cy.get(DataViewLocators.clearFiltersBtn).click();

//select post
//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();
cy.contains(this.postTitle).click();

//change post to be deleted to "New Post Title for Location"
cy.contains(this.postTitle).click({ force: true });

//delete post
cy.get(PostLocators.postMenuDots).eq(0).click();
Expand Down

0 comments on commit 29faca6

Please sign in to comment.