-
Notifications
You must be signed in to change notification settings - Fork 50
Fix navigation e2e tests #2146
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
base: trunk
Are you sure you want to change the base?
Fix navigation e2e tests #2146
Conversation
📊 Performance Test ResultsComparing 292625e vs trunk site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change |
sejas
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested it locally and for me the test creates a post fails. It seems that it correctly clicks the Publish button, but then it automatically clicks the "View post" button even before the post has been saved, so when the posts load, the new post doesn't appear yet.
e2e-view-post-error.mp4
I tested with these two commands:
npx playwright test --grep "Site Navigation" --ui
and
❯ npm run e2e -- site-navigation.test.ts
> [email protected] e2e
> npx playwright install && npx playwright test site-navigation.test.ts
Running 9 tests using 1 worker
✓ 1 e2e/site-navigation.test.ts:77:6 › Site Navigation › opens site at homepage (626ms)
✓ 2 e2e/site-navigation.test.ts:94:6 › Site Navigation › opens and automatically logs in to WP Admin (4.9s)
✘ 3 e2e/site-navigation.test.ts:110:6 › Site Navigation › creates a post (21.6s)
✓ 4 e2e/site-navigation.test.ts:156:6 › Site Navigation › uploads media (9.3s)
✓ 5 e2e/site-navigation.test.ts:192:6 › Site Navigation › activates themes (2.4s)
✓ 6 e2e/site-navigation.test.ts:218:6 › Site Navigation › adds new themes (17.6s)
✓ 7 e2e/site-navigation.test.ts:247:6 › Site Navigation › activates plugin (3.0s)
✓ 8 e2e/site-navigation.test.ts:269:6 › Site Navigation › adds new plugin (18.3s)
✓ 9 e2e/site-navigation.test.ts:299:6 › Site Navigation › "Post name" permalink structure works (13.6s)
1) e2e/site-navigation.test.ts:110:6 › Site Navigation › creates a post ──────────────────────────
Error: Timed out 10000ms waiting for expect(locator).toBeVisible()
Locator: locator('a.row-title:has-text("E2E Test Post")')
Expected: visible
Received: <element(s) not found>
Call log:
- expect.toBeVisible with timeout 10000ms
- waiting for locator('a.row-title:has-text("E2E Test Post")')
151 | // Verify post was created by visiting posts list
152 | await page.goto( getUrlWithAutoLogin( `${ wpAdminUrl }/edit.php` ) );
> 153 | await expect( page.locator( 'a.row-title:has-text("E2E Test Post")' ) ).toBeVisible();
| ^
154 | } );
155 |
156 | test( 'uploads media', async ( { page } ) => {
at /Users/macbookpro/Documents/projects-m3.nosync/studio/e2e/site-navigation.test.ts:153:75
Error Context: test-results/site-navigation-Site-Navigation-creates-a-post/error-context.md
attachment #2: trace (application/zip) ─────────────────────────────────────────────────────────
test-results/site-navigation-Site-Navigation-creates-a-post/trace.zip
Usage:
npx playwright show-trace test-results/site-navigation-Site-Navigation-creates-a-post/trace.zip
────────────────────────────────────────────────────────────────────────────────────────────────
1 failed
e2e/site-navigation.test.ts:110:6 › Site Navigation › creates a post ───────────────────────────
8 passed (2.3m)
Related issues
I noticed that after merging #2054, a couple of tests were still flaky on trunk. This PR fixes the issues reported on these runs: 39bbd-pb
Proposed Changes
Testing Instructions
Pre-merge Checklist