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

chore: document test migration #4265

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { routes as express } from "../../../../helpers/express"
import { routes as react } from "../../../../helpers/react"
import { appPrefix } from "../../../../helpers"

// playwright:migrated
describe("Handling self-service error flows", () => {
;[
{
Expand All @@ -24,6 +25,7 @@ describe("Handling self-service error flows", () => {
cy.proxy(app)
})

// playwright:migrated
it("should show the error", () => {
cy.visit(`${route}/error?id=stub:500`, {
failOnStatusCode: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { appPrefix, gen } from "../../../../helpers"
import { routes as express } from "../../../../helpers/express"
import { routes as react } from "../../../../helpers/react"

// playwright:migrated
describe("Basic email profile with failing login flows", () => {
;[
{
Expand All @@ -29,6 +30,7 @@ describe("Basic email profile with failing login flows", () => {
cy.visit(route)
})

// playwright:migrated
it("fails when CSRF cookies are missing", () => {
cy.get(`${appPrefix(app)}input[name="identifier"]`).type(
"i-do-not-exist",
Expand All @@ -38,14 +40,17 @@ describe("Basic email profile with failing login flows", () => {
cy.shouldHaveCsrfError({ app })
})

// playwright:migrated
it("fails when a disallowed return_to url is requested", () => {
cy.shouldErrorOnDisallowedReturnTo(
route + "?return_to=https://not-allowed",
{ app },
)
})

// playwright:migrated - partially
describe("shows validation errors when invalid signup data is used", () => {
// playwright:migrated
it("should show an error when the identifier is missing", () => {
// the browser will prevent the form from submitting if the fields are empty since they are required
// here we just remove the required attribute to make the form submit
Expand All @@ -64,6 +69,7 @@ describe("Basic email profile with failing login flows", () => {
)
})

// playwright:migrated
it("should show an error when the password is missing", () => {
const identity = gen.email()
cy.get('input[name="identifier"]')
Expand All @@ -85,6 +91,7 @@ describe("Basic email profile with failing login flows", () => {
})
})

// playwright:migrated
it("should show fail to sign in", () => {
cy.get('input[name="identifier"]').type("i-do-not-exist")
cy.get('input[name="password"]').type("invalid-password")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { APP_URL, appPrefix, gen, website } from "../../../../helpers"
import { routes as express } from "../../../../helpers/express"
import { routes as react } from "../../../../helpers/react"

// playwright:migrated
describe("Basic email profile with succeeding login flows", () => {
const email = gen.email()
const password = gen.password()
Expand Down Expand Up @@ -35,6 +36,7 @@ describe("Basic email profile with succeeding login flows", () => {
cy.visit(route)
})

// playwright:migrated
it("should sign in and be logged in", () => {
cy.get(`${appPrefix(app)}input[name="identifier"]`).type(email)
cy.get('input[name="password"]').type(password)
Expand All @@ -51,6 +53,7 @@ describe("Basic email profile with succeeding login flows", () => {
})
})

// playwright:migrated
it("should sign in with case insensitive identifier surrounded by whitespace", () => {
cy.get('input[name="identifier"]').type(
" " + email.toUpperCase() + " ",
Expand All @@ -69,6 +72,7 @@ describe("Basic email profile with succeeding login flows", () => {
})
})

// playwright:migrated
it("should sign in and be redirected", () => {
cy.browserReturnUrlOry()
cy.visit(route + "?return_to=https://www.example.org/")
Expand All @@ -82,6 +86,7 @@ describe("Basic email profile with succeeding login flows", () => {
})
})

// playwright:migrated
describe("for app express handle return_to correctly for expired flows", () => {
before(() => {
cy.proxy("express")
Expand All @@ -94,6 +99,7 @@ describe("Basic email profile with succeeding login flows", () => {
cy.clearAllCookies()
})

// playwright:migrated
it("should redirect to return_to when retrying expired flow", () => {
cy.shortLoginLifespan()
cy.wait(500)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { routes as express } from "../../../../helpers/express"
import { routes as react } from "../../../../helpers/react"
import { appPrefix } from "../../../../helpers"

// playwright:migrated
context("UI tests using the email profile", () => {
;[
{
Expand All @@ -28,6 +29,7 @@ context("UI tests using the email profile", () => {
cy.visit(route)
})

// playwright:migrated
it("should use the json schema titles", () => {
cy.get(`${appPrefix(app)}input[name="identifier"]`)
.parent()
Expand All @@ -39,6 +41,7 @@ context("UI tests using the email profile", () => {
cy.get('button[value="password"]').should("contain.text", "Sign in")
})

// playwright:migrated
it("clicks the log in link", () => {
cy.get('a[href*="registration"]').click()
cy.location("pathname").should("include", "registration")
Expand Down
Loading