@camunda/e2e-test-suite 0.0.161 → 0.0.162

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.
@@ -1,7 +1,19 @@
1
1
  import { Page, Locator } from '@playwright/test';
2
+ type ViolationEffect = 'ARIA_INVALID_STATE' | 'BUTTON_DISABLED' | 'FAILURE';
3
+ interface ValidInputSchema {
4
+ _schema: {
5
+ maxlength: number;
6
+ minlength: number;
7
+ violationEffect: ViolationEffect;
8
+ };
9
+ }
10
+ type Field = {
11
+ locator: Locator;
12
+ schema: ValidInputSchema;
13
+ };
2
14
  declare class LoginPage {
3
15
  private page;
4
- readonly usernameInput: Locator;
16
+ readonly usernameInput: Field;
5
17
  readonly passwordInput: Locator;
6
18
  readonly continueButton: Locator;
7
19
  readonly loginButton: Locator;
@@ -3,6 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LoginPage = void 0;
4
4
  const test_1 = require("@playwright/test");
5
5
  const UtilitiesPage_1 = require("./UtilitiesPage");
6
+ const userNameInputValidInputSchema = {
7
+ _schema: {
8
+ maxlength: 254,
9
+ minlength: 5,
10
+ violationEffect: 'ARIA_INVALID_STATE',
11
+ },
12
+ };
6
13
  class LoginPage {
7
14
  page;
8
15
  usernameInput;
@@ -14,7 +21,10 @@ class LoginPage {
14
21
  passwordHeading;
15
22
  constructor(page) {
16
23
  this.page = page;
17
- this.usernameInput = page.getByLabel('Email address');
24
+ this.usernameInput = {
25
+ locator: page.getByLabel('Email address'),
26
+ schema: userNameInputValidInputSchema,
27
+ };
18
28
  this.passwordInput = page.getByLabel('Password *');
19
29
  this.continueButton = page.getByRole('button', {
20
30
  name: 'Continue',
@@ -31,7 +41,7 @@ class LoginPage {
31
41
  this.errorMessage = page.getByText('Wrong email or password');
32
42
  }
33
43
  async fillUsername(username) {
34
- await this.usernameInput.fill(username);
44
+ await this.usernameInput.locator.fill(username);
35
45
  }
36
46
  async clickContinueButton() {
37
47
  await this.continueButton.click({ timeout: 30000 });
@@ -44,7 +54,7 @@ class LoginPage {
44
54
  }
45
55
  async login(credentials = {}) {
46
56
  const { username = process.env.C8_USERNAME, password = process.env.C8_PASSWORD, } = credentials;
47
- await (0, test_1.expect)(this.usernameInput).toBeVisible({ timeout: 200000 });
57
+ await (0, test_1.expect)(this.usernameInput.locator).toBeVisible({ timeout: 200000 });
48
58
  await this.fillUsername(username);
49
59
  await this.clickContinueButton();
50
60
  await this.fillPassword(password);
@@ -54,7 +64,7 @@ class LoginPage {
54
64
  }
55
65
  async loginWithTestUser(credentials = {}) {
56
66
  const { username = process.env.C8_USERNAME_TEST, password = process.env.C8_PASSWORD_TEST, } = credentials;
57
- await (0, test_1.expect)(this.usernameInput).toBeVisible({ timeout: 120000 });
67
+ await (0, test_1.expect)(this.usernameInput.locator).toBeVisible({ timeout: 120000 });
58
68
  await this.fillUsername(username);
59
69
  await this.clickContinueButton();
60
70
  await this.fillPassword(password);
@@ -72,7 +82,7 @@ class LoginPage {
72
82
  }
73
83
  async loginWithoutOrgAssertion(credentials = {}) {
74
84
  const { username = process.env.C8_USERNAME, password = process.env.C8_PASSWORD, } = credentials;
75
- await (0, test_1.expect)(this.usernameInput).toBeVisible({ timeout: 180000 });
85
+ await (0, test_1.expect)(this.usernameInput.locator).toBeVisible({ timeout: 180000 });
76
86
  await this.fillUsername(username);
77
87
  await this.clickContinueButton();
78
88
  await this.fillPassword(password);
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const test_1 = require("@playwright/test");
4
+ const _setup_1 = require("../../test-setup.js");
5
+ const _8_9_1 = require("../../fixtures/8.9");
6
+ const sleep_1 = require("../../utils/sleep");
7
+ _8_9_1.test.describe.configure({ mode: 'parallel' });
8
+ _8_9_1.test.describe('Login Tests - invalid-input - (negative) generated', () => {
9
+ _8_9_1.test.beforeEach(async ({ page }, testInfo) => {
10
+ await page.goto('/');
11
+ await (0, sleep_1.sleep)((testInfo.workerIndex + 1) * 1000);
12
+ });
13
+ _8_9_1.test.afterEach(async ({ page }, testInfo) => {
14
+ await (0, _setup_1.captureScreenshot)(page, testInfo);
15
+ await (0, _setup_1.captureFailureVideo)(page, testInfo);
16
+ });
17
+ (0, _8_9_1.test)('Basic Login - invalid usernameInput minlength', async ({ loginPage }) => {
18
+ const usernameInputTooShort = 'aaaa';
19
+ await loginPage.fillUsername(usernameInputTooShort);
20
+ await loginPage.clickContinueButton();
21
+ await (0, test_1.expect)(loginPage.usernameInput.locator).toHaveAttribute('aria-invalid', 'true');
22
+ });
23
+ (0, _8_9_1.test)('Basic Login - invalid usernameInput maxlength', async ({ loginPage }) => {
24
+ const usernameInputTooLong = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa';
25
+ await loginPage.fillUsername(usernameInputTooLong);
26
+ await loginPage.clickContinueButton();
27
+ await (0, test_1.expect)(loginPage.usernameInput.locator).toHaveAttribute('aria-invalid', 'true');
28
+ });
29
+ });
@@ -16,7 +16,6 @@ _8_9_1.test.describe('Login Tests', () => {
16
16
  });
17
17
  (0, _8_9_1.test)('Basic Login', async ({ loginPage, homePage }) => {
18
18
  await loginPage.fillUsername(process.env.C8_USERNAME);
19
- await (0, test_1.expect)(loginPage.usernameInput).toHaveValue(process.env.C8_USERNAME);
20
19
  await (0, test_1.expect)(loginPage.loginMessage).toBeVisible();
21
20
  await loginPage.clickContinueButton();
22
21
  await loginPage.fillPassword(process.env.C8_PASSWORD);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.161",
3
+ "version": "0.0.162",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",
@@ -29,6 +29,7 @@
29
29
  "author": "",
30
30
  "license": "ISC",
31
31
  "devDependencies": {
32
+ "@camunda/gremlin": "file:tools/gremlin",
32
33
  "@inquirer/prompts": "^3.2.0",
33
34
  "@playwright/test": "^1.49.0",
34
35
  "@types/axios": "^0.14.0",