-
Notifications
You must be signed in to change notification settings - Fork 51
Clean up e2e tests #2168
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?
Clean up e2e tests #2168
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| import { type Page } from '@playwright/test'; | ||
| import { expect } from '@playwright/test'; | ||
| import MainSidebar from './main-sidebar'; | ||
| import AddSiteModal from './add-site-modal'; | ||
| import WhatsNewModal from './whats-new-modal'; | ||
|
|
||
| export default class Onboarding { | ||
| constructor( private page: Page ) {} | ||
|
|
@@ -20,8 +21,7 @@ export default class Onboarding { | |
|
|
||
| await expect( this.heading ).toBeVisible(); | ||
| await this.locator.getByRole( 'button', { name: 'Skip →' } ).click(); | ||
| const sidebar = new MainSidebar( this.page ); | ||
| const modal = await sidebar.openAddSiteModal(); | ||
| const modal = new AddSiteModal( this.page ); | ||
| await modal.createSiteButton.click(); | ||
|
|
||
| if ( customSiteName ) { | ||
|
|
@@ -42,4 +42,11 @@ export default class Onboarding { | |
| localPath, | ||
| }; | ||
| } | ||
|
|
||
| async closeWhatsNew() { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moved closeWhatsNew to onboarding to avoid duplications and keep consistency
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💯 |
||
| const whatsNewModal = new WhatsNewModal( this.page ); | ||
| if ( await whatsNewModal.locator.isVisible( { timeout: 5000 } ) ) { | ||
| await whatsNewModal.closeButton.click(); | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,8 +10,4 @@ export default class WhatsNewModal { | |
| get closeButton() { | ||
| return this.locator.getByRole( 'button', { name: 'Close' } ); | ||
| } | ||
|
|
||
| async close() { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need it |
||
| await this.closeButton.click(); | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.
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 think it's better to keep this function more specific, since if it's not available in UI then we can mute an error
Also, with the current use case - there is no such thing as "sidebar" inside onboarding, so it's a bit misleading to create
MainSidebarand runningopenAddSiteModal, instead of directly runningnew AddSiteModal.