Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix and improve some e2e tests #3572

Merged
merged 25 commits into from
Oct 19, 2023
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
2e129eb
Wait until the comments are indexed
felipeelia Jul 31, 2023
f975fb2
Remove unnecessary call to WP_CLI::runcommand
felipeelia Jul 31, 2023
198be38
Merge wp-cli calls + wait until the setup is done
felipeelia Jul 31, 2023
a88026b
Merge branch 'develop' into chore/e2e-tests-fix
felipeelia Aug 1, 2023
7084587
Fix get_index_names call
felipeelia Aug 1, 2023
2378165
Try to assign a term during the movie creation
felipeelia Aug 1, 2023
ce7906b
Fix url
felipeelia Aug 1, 2023
cf79226
Checks it without retrying
felipeelia Aug 1, 2023
92781d3
set the runMode back to 1
felipeelia Aug 1, 2023
27e2ca2
Assign the term separately
felipeelia Aug 2, 2023
f7cc488
Merge branch 'develop' into chore/e2e-tests-fix
felipeelia Oct 3, 2023
e8e390b
Flush rewrite rules during plugin activation
felipeelia Oct 3, 2023
cba2b14
Bump wait time
felipeelia Oct 4, 2023
2bed5ce
Update Cypress
felipeelia Oct 4, 2023
ac11781
Rearrange lines a bit
felipeelia Oct 4, 2023
bf5d518
Merge branch 'develop' into chore/e2e-tests-fix
felipeelia Oct 5, 2023
a564f12
Merge branch 'develop' into chore/e2e-tests-fix
felipeelia Oct 12, 2023
5c0519a
Merge branch '5.0.0' into chore/e2e-tests-fix
felipeelia Oct 17, 2023
31cc521
Skip WP.org translations lookup and reorder plugin activation
felipeelia Oct 18, 2023
1ada430
Always refresh before getting stats
felipeelia Oct 18, 2023
f45c299
Make sure billing email is filled in
felipeelia Oct 18, 2023
4042570
Drag to the top
felipeelia Oct 18, 2023
bb200f2
Wait for the ajax request in the second time too
felipeelia Oct 18, 2023
7b752c1
Wait for ajax requests
felipeelia Oct 18, 2023
991b6fc
Try repeating the timeout
felipeelia Oct 18, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 37 additions & 17 deletions tests/cypress/integration/features/comments.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,29 +273,49 @@ describe('Comments Feature', { tags: '@slow' }, () => {
cy.visit('/');
cy.contains('#main .entry-title a', 'Test Comment').first().click();
cy.get('#comment').type('This is a anonymous comment');
cy.get('#submit').click();

// start sync and test results.
cy.wpCli('wp elasticpress index')
.its('stdout')
.should('contain', `Number of comments indexed: ${defaultApprovedComments}`);
cy.get('#submit')
.click()
.then(() => {
cy.wpCli('wp elasticpress sync')
.its('stdout')
.should('contain', `Number of comments indexed: ${defaultApprovedComments}`);
});

// approve the comment
cy.visitAdminPage('edit-comments.php?comment_status=moderated');
cy.get('.approve a').first().click({ force: true });

// Check the number of comments.
cy.wpCli('wp elasticpress stats')
.its('stdout')
.should('contain', `Documents: ${defaultApprovedComments + 1}`);
cy.get('.approve a')
.first()
.click({ force: true })
.then(() => {
/**
* Give Elasticsearch some time to process the post.
*
*/
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(2000);

cy.wpCli('wp elasticpress stats')
.its('stdout')
.should('contain', `Documents: ${defaultApprovedComments + 1}`);
});

// trash the comment
cy.visitAdminPage('edit-comments.php?comment_status=approved');
cy.get('.column-comment .trash a').first().click({ force: true });

cy.wpCli('wp elasticpress stats')
.its('stdout')
.should('contain', `Documents: ${defaultApprovedComments}`);
cy.get('.column-comment .trash a')
.first()
.click({ force: true })
.then(() => {
/**
* Give Elasticsearch some time to process the post.
*
*/
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(2000);

cy.wpCli('wp elasticpress stats')
.its('stdout')
.should('contain', `Documents: ${defaultApprovedComments}`);
});
});

it('Can sync woocommerce reviews', () => {
Expand Down