@toolstackhq/create-qa-patterns 1.0.10 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toolstackhq/create-qa-patterns",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "CLI for generating QA framework templates.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -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<JQuery<HTMLElement>> {
6
+ usernameInput(): Cypress.Chainable {
7
7
  return cy.get("#username");
8
8
  },
9
9
 
10
- passwordInput(): Cypress.Chainable<JQuery<HTMLElement>> {
10
+ passwordInput(): Cypress.Chainable {
11
11
  return cy.get("#password");
12
12
  },
13
13
 
14
- submitButton(): Cypress.Chainable<JQuery<HTMLElement>> {
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<JQuery<HTMLElement>> {
4
+ heading(): Cypress.Chainable {
5
5
  return cy.contains("h1", "People");
6
6
  },
7
7
 
8
- welcomeMessage(): Cypress.Chainable<JQuery<HTMLElement>> {
8
+ welcomeMessage(): Cypress.Chainable {
9
9
  return cy.get("[data-testid='welcome-message']");
10
10
  },
11
11
 
12
- flashMessage(): Cypress.Chainable<JQuery<HTMLElement>> {
12
+ flashMessage(): Cypress.Chainable {
13
13
  return cy.get("[data-testid='flash-message']");
14
14
  },
15
15
 
16
- personIdInput(): Cypress.Chainable<JQuery<HTMLElement>> {
16
+ personIdInput(): Cypress.Chainable {
17
17
  return cy.get("#personId");
18
18
  },
19
19
 
20
- nameInput(): Cypress.Chainable<JQuery<HTMLElement>> {
20
+ nameInput(): Cypress.Chainable {
21
21
  return cy.get("#name");
22
22
  },
23
23
 
24
- roleInput(): Cypress.Chainable<JQuery<HTMLElement>> {
24
+ roleInput(): Cypress.Chainable {
25
25
  return cy.get("#role");
26
26
  },
27
27
 
28
- emailInput(): Cypress.Chainable<JQuery<HTMLElement>> {
28
+ emailInput(): Cypress.Chainable {
29
29
  return cy.get("#email");
30
30
  },
31
31
 
32
- submitButton(): Cypress.Chainable<JQuery<HTMLElement>> {
32
+ submitButton(): Cypress.Chainable {
33
33
  return cy.contains("button", "Add person");
34
34
  },
35
35
 
36
- personRow(personId: string): Cypress.Chainable<JQuery<HTMLElement>> {
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<JQuery<HTMLElement>> {
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<JQuery<HTMLElement>> {
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<JQuery<HTMLElement>> {
48
+ emailCell(personId: string): Cypress.Chainable {
49
49
  return this.personRow(personId).find("td").eq(2);
50
50
  },
51
51
 
@@ -100,6 +100,12 @@ export default [
100
100
  ]
101
101
  }
102
102
  },
103
+ {
104
+ files: ["cypress/support/commands.ts"],
105
+ rules: {
106
+ "@typescript-eslint/no-namespace": "off"
107
+ }
108
+ },
103
109
  {
104
110
  files: ["cypress/support/pages/**/*.ts"],
105
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 {};