-
Notifications
You must be signed in to change notification settings - Fork 539
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
Refactor E2E tests to use Page Object Model (POM), fixtures, and add additional tests #2945
Conversation
@@ -39,6 +39,7 @@ | |||
:sort-by.sync="sortBy" | |||
:sort-desc.sync="descending" | |||
:loading="loading" | |||
data-testid="incident-data-table" |
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.
We may want to consider a single SOT for these data-testid
strings as an Enum
that we can use here and in tests Pages
|
||
async function register(authPage: AuthPage): Promise<void> { | ||
let email = generateRandomString() + "@example.com" | ||
let password = generateRandomString() |
Check failure
Code scanning / CodeQL
Insecure randomness
@@ -0,0 +1,9 @@ | |||
export const orgSlug = "default" | |||
|
|||
export enum Routes { |
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.
Would be nice if we could import these directly from the Vue router. I was unable to import the routes because of an issue with this line and others upon import (can't use this outside module, or similar error):
const authProviderSlug =
import.meta.env.VITE_DISPATCH_AUTHENTICATION_PROVIDER_SLUG || "dispatch-auth-provider-basic"
readonly EditRunWorkflow: Locator | ||
readonly EditDelete: Locator | ||
|
||
constructor(page: Page, incident: string = `dispatch-${orgSlug}-${orgSlug}-2`) { |
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.
The default incident here is a bit fragile to it being present in the table, there's probably a better way.
https://playwright.dev/docs/pom
https://playwright.dev/docs/test-fixtures