@toolstackhq/create-qa-patterns 1.0.9 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/templates/cypress-template/cypress/support/commands.ts +12 -0
- package/templates/cypress-template/cypress/support/pages/login-page.ts +3 -3
- package/templates/cypress-template/cypress/support/pages/people-page.ts +12 -12
- package/templates/cypress-template/eslint.config.mjs +9 -1
- package/templates/cypress-template/cypress/support/commands.d.ts +0 -15
package/package.json
CHANGED
|
@@ -2,6 +2,16 @@ import type { PersonRecord } from "./data/data-factory";
|
|
|
2
2
|
import { loginPage } from "./pages/login-page";
|
|
3
3
|
import { peoplePage } from "./pages/people-page";
|
|
4
4
|
|
|
5
|
+
declare global {
|
|
6
|
+
namespace Cypress {
|
|
7
|
+
interface Chainable {
|
|
8
|
+
getByTestId(testId: string): Chainable<JQuery<HTMLElement>>;
|
|
9
|
+
signIn(username: string, password: string): Chainable<void>;
|
|
10
|
+
addPerson(person: PersonRecord): Chainable<void>;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
5
15
|
Cypress.Commands.add("getByTestId", (testId: string) => {
|
|
6
16
|
return cy.get(`[data-testid='${testId}']`);
|
|
7
17
|
});
|
|
@@ -15,3 +25,5 @@ Cypress.Commands.add("signIn", (username: string, password: string) => {
|
|
|
15
25
|
Cypress.Commands.add("addPerson", (person: PersonRecord) => {
|
|
16
26
|
peoplePage.addPerson(person);
|
|
17
27
|
});
|
|
28
|
+
|
|
29
|
+
export {};
|
|
@@ -3,15 +3,15 @@ export const loginPage = {
|
|
|
3
3
|
return cy.visit("/login");
|
|
4
4
|
},
|
|
5
5
|
|
|
6
|
-
usernameInput(): Cypress.Chainable
|
|
6
|
+
usernameInput(): Cypress.Chainable {
|
|
7
7
|
return cy.get("#username");
|
|
8
8
|
},
|
|
9
9
|
|
|
10
|
-
passwordInput(): Cypress.Chainable
|
|
10
|
+
passwordInput(): Cypress.Chainable {
|
|
11
11
|
return cy.get("#password");
|
|
12
12
|
},
|
|
13
13
|
|
|
14
|
-
submitButton(): Cypress.Chainable
|
|
14
|
+
submitButton(): Cypress.Chainable {
|
|
15
15
|
return cy.contains("button", "Sign in");
|
|
16
16
|
},
|
|
17
17
|
|
|
@@ -1,51 +1,51 @@
|
|
|
1
1
|
import type { PersonRecord } from "../data/data-factory";
|
|
2
2
|
|
|
3
3
|
export const peoplePage = {
|
|
4
|
-
heading(): Cypress.Chainable
|
|
4
|
+
heading(): Cypress.Chainable {
|
|
5
5
|
return cy.contains("h1", "People");
|
|
6
6
|
},
|
|
7
7
|
|
|
8
|
-
welcomeMessage(): Cypress.Chainable
|
|
8
|
+
welcomeMessage(): Cypress.Chainable {
|
|
9
9
|
return cy.get("[data-testid='welcome-message']");
|
|
10
10
|
},
|
|
11
11
|
|
|
12
|
-
flashMessage(): Cypress.Chainable
|
|
12
|
+
flashMessage(): Cypress.Chainable {
|
|
13
13
|
return cy.get("[data-testid='flash-message']");
|
|
14
14
|
},
|
|
15
15
|
|
|
16
|
-
personIdInput(): Cypress.Chainable
|
|
16
|
+
personIdInput(): Cypress.Chainable {
|
|
17
17
|
return cy.get("#personId");
|
|
18
18
|
},
|
|
19
19
|
|
|
20
|
-
nameInput(): Cypress.Chainable
|
|
20
|
+
nameInput(): Cypress.Chainable {
|
|
21
21
|
return cy.get("#name");
|
|
22
22
|
},
|
|
23
23
|
|
|
24
|
-
roleInput(): Cypress.Chainable
|
|
24
|
+
roleInput(): Cypress.Chainable {
|
|
25
25
|
return cy.get("#role");
|
|
26
26
|
},
|
|
27
27
|
|
|
28
|
-
emailInput(): Cypress.Chainable
|
|
28
|
+
emailInput(): Cypress.Chainable {
|
|
29
29
|
return cy.get("#email");
|
|
30
30
|
},
|
|
31
31
|
|
|
32
|
-
submitButton(): Cypress.Chainable
|
|
32
|
+
submitButton(): Cypress.Chainable {
|
|
33
33
|
return cy.contains("button", "Add person");
|
|
34
34
|
},
|
|
35
35
|
|
|
36
|
-
personRow(personId: string): Cypress.Chainable
|
|
36
|
+
personRow(personId: string): Cypress.Chainable {
|
|
37
37
|
return cy.get(`[data-testid='person-row-${personId}']`);
|
|
38
38
|
},
|
|
39
39
|
|
|
40
|
-
nameCell(personId: string): Cypress.Chainable
|
|
40
|
+
nameCell(personId: string): Cypress.Chainable {
|
|
41
41
|
return this.personRow(personId).find("td").eq(0);
|
|
42
42
|
},
|
|
43
43
|
|
|
44
|
-
roleCell(personId: string): Cypress.Chainable
|
|
44
|
+
roleCell(personId: string): Cypress.Chainable {
|
|
45
45
|
return this.personRow(personId).find("td").eq(1);
|
|
46
46
|
},
|
|
47
47
|
|
|
48
|
-
emailCell(personId: string): Cypress.Chainable
|
|
48
|
+
emailCell(personId: string): Cypress.Chainable {
|
|
49
49
|
return this.personRow(personId).find("td").eq(2);
|
|
50
50
|
},
|
|
51
51
|
|
|
@@ -67,7 +67,9 @@ export default [
|
|
|
67
67
|
}
|
|
68
68
|
},
|
|
69
69
|
rules: {
|
|
70
|
-
"no-undef": "off"
|
|
70
|
+
"no-undef": "off",
|
|
71
|
+
"no-unused-vars": "off",
|
|
72
|
+
"@typescript-eslint/no-unused-vars": "off"
|
|
71
73
|
}
|
|
72
74
|
},
|
|
73
75
|
{
|
|
@@ -98,6 +100,12 @@ export default [
|
|
|
98
100
|
]
|
|
99
101
|
}
|
|
100
102
|
},
|
|
103
|
+
{
|
|
104
|
+
files: ["cypress/support/commands.ts"],
|
|
105
|
+
rules: {
|
|
106
|
+
"@typescript-eslint/no-namespace": "off"
|
|
107
|
+
}
|
|
108
|
+
},
|
|
101
109
|
{
|
|
102
110
|
files: ["cypress/support/pages/**/*.ts"],
|
|
103
111
|
rules: {
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/// <reference types="cypress" />
|
|
2
|
-
|
|
3
|
-
import type { PersonRecord } from "./data/data-factory";
|
|
4
|
-
|
|
5
|
-
declare global {
|
|
6
|
-
namespace Cypress {
|
|
7
|
-
interface Chainable {
|
|
8
|
-
getByTestId(testId: string): Chainable<JQuery<HTMLElement>>;
|
|
9
|
-
signIn(username: string, password: string): Chainable<void>;
|
|
10
|
-
addPerson(person: PersonRecord): Chainable<void>;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export {};
|