Skip to content
This repository was archived by the owner on Sep 3, 2025. It is now read-only.

Refactor E2E tests to use Page Object Model (POM), fixtures, and add additional tests - #2945

Merged
3 commits merged into
masterfrom
tests/playwright-improvements
Feb 6, 2023
Merged

3 commits merged into
masterfrom
tests/playwright-improvements

Conversation

@ghost

@ghost ghost commented Feb 6, 2023 •

Copy link
Copy Markdown

@ghost ghost added enhancement New feature or request tests UI/UX javascript Pull requests that update Javascript code labels Feb 6, 2023
:sort-by.sync="sortBy"
:sort-desc.sync="descending"
:loading="loading"
data-testid="incident-data-table"

Copy link
Copy Markdown
Author

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

This uses a cryptographically insecure random number generated at [Math.random()](1) in a security context.
@@ -0,0 +1,9 @@
export const orgSlug = "default"

export enum Routes {

@ghost ghost Feb 6, 2023 •

Copy link
Copy Markdown
Author

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`) {

Copy link
Copy Markdown
Author

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.

@ghost
ghost merged commit ecc8d7a into master Feb 6, 2023
@ghost
ghost deleted the tests/playwright-improvements branch February 6, 2023 17:49
@ghost ghost changed the title Refact E2E tests to use Page Object Model (POM), fixtures, and add additional tests Refactor E2E tests to use Page Object Model (POM), fixtures, and add additional tests Feb 6, 2023
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request javascript Pull requests that update Javascript code tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant