From 7e56e1cccfe9183e4be0c392cfc917b4292d06c2 Mon Sep 17 00:00:00 2001 From: Zhihe Li Date: Tue, 12 Nov 2024 18:11:00 -0500 Subject: [PATCH] =?UTF-8?q?style:=20=F0=9F=92=84=20Run=20prettier=20on=20e?= =?UTF-8?q?2e=20tests=20(#2560)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- e2e-tests/admin/global-setup.js | 3 +- e2e-tests/admin/pages/login.js | 10 +++- e2e-tests/admin/pages/session-recordings.js | 4 +- e2e-tests/admin/pages/workers.js | 6 +- e2e-tests/admin/tests/alias-ent.spec.js | 57 ++++++++++++++----- e2e-tests/admin/tests/alias.spec.js | 19 +++++-- .../admin/tests/auth-method-ldap.spec.js | 10 +--- .../admin/tests/auth-method-password.spec.js | 2 +- .../tests/credential-store-static-ent.spec.js | 13 ++++- .../tests/credential-store-static.spec.js | 57 +++++++++++++------ .../tests/credential-store-vault-ent.spec.js | 39 +++++++------ .../tests/credential-store-vault.spec.js | 30 ++++++---- .../admin/tests/delete-resources-ent.spec.js | 48 +++++++++------- .../admin/tests/delete-resources.spec.js | 48 +++++++++------- .../tests/dynamic-host-catalog-aws.spec.js | 10 +--- e2e-tests/admin/tests/global-settings.spec.js | 2 +- e2e-tests/admin/tests/group-role.spec.js | 2 +- e2e-tests/admin/tests/login.spec.js | 22 ++----- e2e-tests/admin/tests/pagination.spec.js | 2 +- .../tests/session-recording-aws-ent.spec.js | 22 +++++-- .../tests/session-recording-minio-ent.spec.js | 26 +++++++-- ...sh-certificate-injection-vault-ent.spec.js | 32 ++++++----- ...ssh-credential-injection-vault-ent.spec.js | 35 +++++++----- e2e-tests/admin/tests/target-ent.spec.js | 33 ++++++++--- e2e-tests/admin/tests/target.spec.js | 9 ++- e2e-tests/admin/tests/worker-ent.spec.js | 2 +- e2e-tests/admin/tests/worker-tags.spec.js | 36 ++++++------ e2e-tests/admin/tests/worker.spec.js | 2 +- e2e-tests/desktop/fixtures/baseTest.js | 2 +- e2e-tests/desktop/pages/loginPage.js | 2 +- .../desktop/tests/authentication.spec.js | 4 +- 31 files changed, 370 insertions(+), 219 deletions(-) diff --git a/e2e-tests/admin/global-setup.js b/e2e-tests/admin/global-setup.js index f0f3257b7..6988b5cc4 100644 --- a/e2e-tests/admin/global-setup.js +++ b/e2e-tests/admin/global-setup.js @@ -40,5 +40,4 @@ async function globalSetup() { export default globalSetup; -export const authenticatedState = - './admin/artifacts/authenticated-state.json'; +export const authenticatedState = './admin/artifacts/authenticated-state.json'; diff --git a/e2e-tests/admin/pages/login.js b/e2e-tests/admin/pages/login.js index fcdaee8cd..b6228ce64 100644 --- a/e2e-tests/admin/pages/login.js +++ b/e2e-tests/admin/pages/login.js @@ -17,8 +17,10 @@ export class LoginPage extends BaseResourcePage { await this.page.getByLabel('Login Name').fill(loginName); await this.page.getByLabel('Password', { exact: true }).fill(password); await this.page.getByRole('button', { name: 'Sign In' }).click(); - await expect(this.page.getByRole('navigation', { name: 'General' })).toBeVisible(); - await expect(this.page.getByText(loginName),).toBeEnabled(); + await expect( + this.page.getByRole('navigation', { name: 'General' }), + ).toBeVisible(); + await expect(this.page.getByText(loginName)).toBeEnabled(); } /** @@ -28,6 +30,8 @@ export class LoginPage extends BaseResourcePage { async logout(loginName) { await this.page.getByText(loginName).click(); await this.page.getByRole('button', { name: 'Sign Out' }).click(); - await expect(this.page.getByRole('button', { name: 'Sign In' })).toBeVisible(); + await expect( + this.page.getByRole('button', { name: 'Sign In' }), + ).toBeVisible(); } } diff --git a/e2e-tests/admin/pages/session-recordings.js b/e2e-tests/admin/pages/session-recordings.js index 6a2904384..c84ffafca 100644 --- a/e2e-tests/admin/pages/session-recordings.js +++ b/e2e-tests/admin/pages/session-recordings.js @@ -18,7 +18,9 @@ export class SessionRecordingsPage extends BaseResourcePage { */ async reapplyStoragePolicy() { await this.page.getByText('Manage').click(); - await this.page.getByRole('button', { name: 'Re-apply storage policy' }).click(); + await this.page + .getByRole('button', { name: 'Re-apply storage policy' }) + .click(); await this.dismissSuccessAlert(); } } diff --git a/e2e-tests/admin/pages/workers.js b/e2e-tests/admin/pages/workers.js index f4202a669..c94b18447 100644 --- a/e2e-tests/admin/pages/workers.js +++ b/e2e-tests/admin/pages/workers.js @@ -37,7 +37,8 @@ export class WorkersPage extends BaseResourcePage { * @param {string} newValue New value for API tag */ async editTag(origKey, newKey, newValue) { - await this.page.getByRole('table') + await this.page + .getByRole('table') .getByRole('cell', { name: origKey }) .locator('..') .getByRole('cell', { name: 'Overflow Options' }) @@ -56,7 +57,8 @@ export class WorkersPage extends BaseResourcePage { * @param {string} key API tag key */ async removeTag(key) { - await this.page.getByRole('table') + await this.page + .getByRole('table') .getByRole('cell', { name: key }) .locator('..') .getByRole('cell', { name: 'Overflow Options' }) diff --git a/e2e-tests/admin/tests/alias-ent.spec.js b/e2e-tests/admin/tests/alias-ent.spec.js index 1fa6154f0..cb723b7e9 100644 --- a/e2e-tests/admin/tests/alias-ent.spec.js +++ b/e2e-tests/admin/tests/alias-ent.spec.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: BUSL-1.1 */ -import { test } from '../playwright.config.js' +import { test } from '../playwright.config.js'; import { expect } from '@playwright/test'; import { customAlphabet } from 'nanoid'; @@ -53,11 +53,21 @@ test.describe('Aliases (Enterprise)', async () => { await projectsPage.createProject(); const targetsPage = new TargetsPage(page); - const targetName = await targetsPage.createSshTargetWithAddressEnt(targetAddress, targetPort); + const targetName = await targetsPage.createSshTargetWithAddressEnt( + targetAddress, + targetPort, + ); const credentialStoresPage = new CredentialStoresPage(page); await credentialStoresPage.createStaticCredentialStore(); - const credentialName = await credentialStoresPage.createStaticCredentialKeyPair(sshUser, sshKeyPath); - await targetsPage.addInjectedCredentialsToTarget(targetName, credentialName); + const credentialName = + await credentialStoresPage.createStaticCredentialKeyPair( + sshUser, + sshKeyPath, + ); + await targetsPage.addInjectedCredentialsToTarget( + targetName, + credentialName, + ); // Create alias for target await page @@ -90,9 +100,9 @@ test.describe('Aliases (Enterprise)', async () => { // Note: On the Target details page, there is a section with the header // "Aliases". The extra check here is to ensure that we are on the Alias // details page and not the Target details page. - await expect( - page.getByRole('heading', { name: 'Alias' }), - ).not.toHaveText('Aliases'); + await expect(page.getByRole('heading', { name: 'Alias' })).not.toHaveText( + 'Aliases', + ); await page.getByRole('button', { name: 'Manage' }).click(); await page.getByText('Clear', { exact: true }).click(); await page.getByText('OK', { exact: true }).click(); @@ -147,11 +157,22 @@ test.describe('Aliases (Enterprise)', async () => { await projectsPage.createProject(); alias = 'example.alias.' + nanoid(); const targetsPage = new TargetsPage(page); - const targetName = await targetsPage.createTargetWithAddressAndAlias(targetAddress, targetPort, alias); + const targetName = await targetsPage.createTargetWithAddressAndAlias( + targetAddress, + targetPort, + alias, + ); const credentialStoresPage = new CredentialStoresPage(page); await credentialStoresPage.createStaticCredentialStore(); - const credentialName = await credentialStoresPage.createStaticCredentialKeyPair(sshUser, sshKeyPath); - await targetsPage.addInjectedCredentialsToTarget(targetName, credentialName); + const credentialName = + await credentialStoresPage.createStaticCredentialKeyPair( + sshUser, + sshKeyPath, + ); + await targetsPage.addInjectedCredentialsToTarget( + targetName, + credentialName, + ); // Connect to target using alias await authorizeSessionByAliasCli(alias); @@ -196,11 +217,21 @@ test.describe('Aliases (Enterprise)', async () => { const projectsPage = new ProjectsPage(page); const projectName = await projectsPage.createProject(); const targetsPage = new TargetsPage(page); - const targetName = await targetsPage.createSshTargetWithAddressEnt(targetAddress, targetPort); + const targetName = await targetsPage.createSshTargetWithAddressEnt( + targetAddress, + targetPort, + ); const credentialStoresPage = new CredentialStoresPage(page); await credentialStoresPage.createStaticCredentialStore(); - const credentialName = await credentialStoresPage.createStaticCredentialKeyPair(sshUser, sshKeyPath); - await targetsPage.addInjectedCredentialsToTarget(targetName, credentialName); + const credentialName = + await credentialStoresPage.createStaticCredentialKeyPair( + sshUser, + sshKeyPath, + ); + await targetsPage.addInjectedCredentialsToTarget( + targetName, + credentialName, + ); // Create new alias from scope page await authenticateBoundaryCli( diff --git a/e2e-tests/admin/tests/alias.spec.js b/e2e-tests/admin/tests/alias.spec.js index 7f805e76e..1e0c041d3 100644 --- a/e2e-tests/admin/tests/alias.spec.js +++ b/e2e-tests/admin/tests/alias.spec.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: BUSL-1.1 */ -import { test } from '../playwright.config.js' +import { test } from '../playwright.config.js'; import { expect } from '@playwright/test'; import { customAlphabet } from 'nanoid'; @@ -78,9 +78,9 @@ test.describe('Aliases', async () => { // Note: On the Target details page, there is a section with the header // "Aliases". The extra check here is to ensure that we are on the Alias // details page and not the Target details page. - await expect( - page.getByRole('heading', { name: 'Alias' }), - ).not.toHaveText('Aliases'); + await expect(page.getByRole('heading', { name: 'Alias' })).not.toHaveText( + 'Aliases', + ); await page.getByRole('button', { name: 'Manage' }).click(); await page.getByText('Clear', { exact: true }).click(); await page.getByText('OK', { exact: true }).click(); @@ -133,7 +133,11 @@ test.describe('Aliases', async () => { await projectsPage.createProject(); alias = 'example.alias.' + nanoid(); const targetsPage = new TargetsPage(page); - await targetsPage.createTargetWithAddressAndAlias(targetAddress, targetPort, alias); + await targetsPage.createTargetWithAddressAndAlias( + targetAddress, + targetPort, + alias, + ); // Connect to target using alias await authorizeSessionByAliasCli(alias); @@ -175,7 +179,10 @@ test.describe('Aliases', async () => { const projectsPage = new ProjectsPage(page); const projectName = await projectsPage.createProject(); const targetsPage = new TargetsPage(page); - const targetName = await targetsPage.createTargetWithAddress(targetAddress, targetPort); + const targetName = await targetsPage.createTargetWithAddress( + targetAddress, + targetPort, + ); // Create new alias from scope page await authenticateBoundaryCli( diff --git a/e2e-tests/admin/tests/auth-method-ldap.spec.js b/e2e-tests/admin/tests/auth-method-ldap.spec.js index ea309d6ed..60e6b22a0 100644 --- a/e2e-tests/admin/tests/auth-method-ldap.spec.js +++ b/e2e-tests/admin/tests/auth-method-ldap.spec.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: BUSL-1.1 */ -import { test } from '../playwright.config.js' +import { test } from '../playwright.config.js'; import { expect } from '@playwright/test'; import { nanoid } from 'nanoid'; @@ -62,9 +62,7 @@ test('Set up LDAP auth method @ce @ent @docker', async ({ await page.getByLabel('Description').fill('LDAP Auth Method'); await page.getByLabel('Address').fill(ldapAddr); await page.getByLabel('Bind DN').fill(ldapAdminDn); - await page - .getByLabel('Bind Password') - .fill(ldapAdminPassword); + await page.getByLabel('Bind Password').fill(ldapAdminPassword); await page.getByRole('switch', { name: 'Discover DN' }).click(); await page.getByLabel('User DN').fill(ldapDomainDn); await page.getByLabel('User Attribute').fill('uid'); @@ -145,9 +143,7 @@ test('Set up LDAP auth method @ce @ent @docker', async ({ const ldapManagedGroupName = 'LDAP Managed Group ' + nanoid(); await page.getByLabel('Name (Optional)').fill(ldapManagedGroupName); await page.getByLabel('Description').fill('This is an automated test'); - await page - .getByRole('textbox', { name: 'Value' }) - .fill(ldapGroupName); + await page.getByRole('textbox', { name: 'Value' }).fill(ldapGroupName); await page.getByRole('button', { name: 'Add' }).click(); await page.getByRole('button', { name: 'Save' }).click(); diff --git a/e2e-tests/admin/tests/auth-method-password.spec.js b/e2e-tests/admin/tests/auth-method-password.spec.js index 4fcbbd1ba..8604dbcb2 100644 --- a/e2e-tests/admin/tests/auth-method-password.spec.js +++ b/e2e-tests/admin/tests/auth-method-password.spec.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: BUSL-1.1 */ -import { test } from '../playwright.config.js' +import { test } from '../playwright.config.js'; import { expect } from '@playwright/test'; import { execSync } from 'node:child_process'; diff --git a/e2e-tests/admin/tests/credential-store-static-ent.spec.js b/e2e-tests/admin/tests/credential-store-static-ent.spec.js index f8d1b3525..6d0ae606f 100644 --- a/e2e-tests/admin/tests/credential-store-static-ent.spec.js +++ b/e2e-tests/admin/tests/credential-store-static-ent.spec.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: BUSL-1.1 */ -import { test } from '../playwright.config.js' +import { test } from '../playwright.config.js'; import { expect } from '@playwright/test'; import { authenticatedState } from '../global-setup.js'; @@ -44,10 +44,17 @@ test('Multiple Credential Stores (ENT) @ent @aws @docker', async ({ const projectsPage = new ProjectsPage(page); await projectsPage.createProject(); const targetsPage = new TargetsPage(page); - const targetName = await targetsPage.createSshTargetWithAddressEnt(targetAddress, targetPort); + const targetName = await targetsPage.createSshTargetWithAddressEnt( + targetAddress, + targetPort, + ); const credentialStoresPage = new CredentialStoresPage(page); await credentialStoresPage.createStaticCredentialStore(); - const credentialName = await credentialStoresPage.createStaticCredentialKeyPair(sshUser, sshKeyPath); + const credentialName = + await credentialStoresPage.createStaticCredentialKeyPair( + sshUser, + sshKeyPath, + ); const credentialName2 = await credentialStoresPage.createStaticCredentialUsernamePassword( sshUser, diff --git a/e2e-tests/admin/tests/credential-store-static.spec.js b/e2e-tests/admin/tests/credential-store-static.spec.js index 50c4e485b..e5198696d 100644 --- a/e2e-tests/admin/tests/credential-store-static.spec.js +++ b/e2e-tests/admin/tests/credential-store-static.spec.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: BUSL-1.1 */ -import { test } from '../playwright.config.js' +import { test } from '../playwright.config.js'; import { expect } from '@playwright/test'; import { readFile } from 'fs/promises'; import { nanoid } from 'nanoid'; @@ -33,11 +33,7 @@ let orgName; let projectName; let targetName; -test.beforeEach(async ({ - page, - targetAddress, - targetPort, -}) => { +test.beforeEach(async ({ page, targetAddress, targetPort }) => { await page.goto('/'); const orgsPage = new OrgsPage(page); @@ -45,7 +41,10 @@ test.beforeEach(async ({ const projectsPage = new ProjectsPage(page); projectName = await projectsPage.createProject(); const targetsPage = new TargetsPage(page); - targetName = await targetsPage.createTargetWithAddress(targetAddress, targetPort); + targetName = await targetsPage.createTargetWithAddress( + targetAddress, + targetPort, + ); const credentialStoresPage = new CredentialStoresPage(page); await credentialStoresPage.createStaticCredentialStore(); }); @@ -61,9 +60,16 @@ test('Static Credential Store (User & Key Pair) @ce @aws @docker', async ({ }) => { try { const credentialStoresPage = new CredentialStoresPage(page); - const credentialName = await credentialStoresPage.createStaticCredentialKeyPair(sshUser, sshKeyPath); + const credentialName = + await credentialStoresPage.createStaticCredentialKeyPair( + sshUser, + sshKeyPath, + ); const targetsPage = new TargetsPage(page); - await targetsPage.addBrokeredCredentialsToTarget(targetName, credentialName); + await targetsPage.addBrokeredCredentialsToTarget( + targetName, + credentialName, + ); await authenticateBoundaryCli( baseURL, @@ -108,14 +114,21 @@ test('Static Credential Store (Username & Password) @ce @aws @docker', async ({ adminAuthMethodId, adminLoginName, adminPassword, - sshUser + sshUser, }) => { try { const testPassword = 'password'; const credentialStoresPage = new CredentialStoresPage(page); - const credentialName = await credentialStoresPage.createStaticCredentialUsernamePassword(sshUser, testPassword); + const credentialName = + await credentialStoresPage.createStaticCredentialUsernamePassword( + sshUser, + testPassword, + ); const targetsPage = new TargetsPage(page); - await targetsPage.addBrokeredCredentialsToTarget(targetName, credentialName); + await targetsPage.addBrokeredCredentialsToTarget( + targetName, + credentialName, + ); await authenticateBoundaryCli( baseURL, @@ -183,7 +196,10 @@ test('Static Credential Store (JSON) @ce @aws @docker', async ({ ).toBeVisible(); const targetsPage = new TargetsPage(page); - await targetsPage.addBrokeredCredentialsToTarget(targetName, credentialName); + await targetsPage.addBrokeredCredentialsToTarget( + targetName, + credentialName, + ); await authenticateBoundaryCli( baseURL, @@ -230,7 +246,10 @@ test('Multiple Credential Stores (CE) @ce @aws @docker', async ({ try { const credentialStoresPage = new CredentialStoresPage(page); const credentialName = - await credentialStoresPage.createStaticCredentialKeyPair(sshUser, sshKeyPath); + await credentialStoresPage.createStaticCredentialKeyPair( + sshUser, + sshKeyPath, + ); const credentialName2 = await credentialStoresPage.createStaticCredentialUsernamePassword( sshUser, @@ -238,8 +257,14 @@ test('Multiple Credential Stores (CE) @ce @aws @docker', async ({ ); const targetsPage = new TargetsPage(page); - await targetsPage.addBrokeredCredentialsToTarget(targetName, credentialName); - await targetsPage.addBrokeredCredentialsToTarget(targetName, credentialName2); + await targetsPage.addBrokeredCredentialsToTarget( + targetName, + credentialName, + ); + await targetsPage.addBrokeredCredentialsToTarget( + targetName, + credentialName2, + ); // Remove the host source from the target await page diff --git a/e2e-tests/admin/tests/credential-store-vault-ent.spec.js b/e2e-tests/admin/tests/credential-store-vault-ent.spec.js index 7c9755064..af512d085 100644 --- a/e2e-tests/admin/tests/credential-store-vault-ent.spec.js +++ b/e2e-tests/admin/tests/credential-store-vault-ent.spec.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: BUSL-1.1 */ -import { test } from '../playwright.config.js' +import { test } from '../playwright.config.js'; import { expect } from '@playwright/test'; import { execSync } from 'child_process'; import { nanoid } from 'nanoid'; @@ -65,8 +65,8 @@ test('Vault Credential Store (User & Key Pair) @ent @aws @docker', async ({ execSync(`vault secrets enable -path=${secretsPath} kv-v2`); execSync( `vault kv put -mount ${secretsPath} ${secretName} ` + - ` username=${sshUser}` + - ` private_key=@${sshKeyPath}`, + ` username=${sshUser}` + + ` private_key=@${sshKeyPath}`, ); execSync( `vault policy write ${secretPolicyName} ./admin/tests/fixtures/kv-policy.hcl`, @@ -74,13 +74,13 @@ test('Vault Credential Store (User & Key Pair) @ent @aws @docker', async ({ const vaultToken = JSON.parse( execSync( `vault token create` + - ` -no-default-policy=true` + - ` -policy=${boundaryPolicyName}` + - ` -policy=${secretPolicyName}` + - ` -orphan=true` + - ` -period=20m` + - ` -renewable=true` + - ` -format=json`, + ` -no-default-policy=true` + + ` -policy=${boundaryPolicyName}` + + ` -policy=${secretPolicyName}` + + ` -orphan=true` + + ` -period=20m` + + ` -renewable=true` + + ` -format=json`, ), ); const clientToken = vaultToken.auth.client_token; @@ -90,13 +90,20 @@ test('Vault Credential Store (User & Key Pair) @ent @aws @docker', async ({ const projectsPage = new ProjectsPage(page); const projectName = await projectsPage.createProject(); const targetsPage = new TargetsPage(page); - const targetName = await targetsPage.createSshTargetWithAddressEnt(targetAddress, targetPort); + const targetName = await targetsPage.createSshTargetWithAddressEnt( + targetAddress, + targetPort, + ); const credentialStoresPage = new CredentialStoresPage(page); - await credentialStoresPage.createVaultCredentialStore(vaultAddr, clientToken); - const credentialLibraryName = await credentialStoresPage.createVaultGenericCredentialLibraryEnt( - `${secretsPath}/data/${secretName}`, - 'SSH Private Key', - ) + await credentialStoresPage.createVaultCredentialStore( + vaultAddr, + clientToken, + ); + const credentialLibraryName = + await credentialStoresPage.createVaultGenericCredentialLibraryEnt( + `${secretsPath}/data/${secretName}`, + 'SSH Private Key', + ); await targetsPage.addInjectedCredentialsToTarget( targetName, credentialLibraryName, diff --git a/e2e-tests/admin/tests/credential-store-vault.spec.js b/e2e-tests/admin/tests/credential-store-vault.spec.js index e16590bb4..c2dc118a4 100644 --- a/e2e-tests/admin/tests/credential-store-vault.spec.js +++ b/e2e-tests/admin/tests/credential-store-vault.spec.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: BUSL-1.1 */ -import { test } from '../playwright.config.js' +import { test } from '../playwright.config.js'; import { expect } from '@playwright/test'; import { execSync } from 'child_process'; import { nanoid } from 'nanoid'; @@ -65,8 +65,8 @@ test('Vault Credential Store (User & Key Pair) @ce @aws @docker', async ({ execSync(`vault secrets enable -path=${secretsPath} kv-v2`); execSync( `vault kv put -mount ${secretsPath} ${secretName} ` + - ` username=${sshUser}` + - ` private_key=@${sshKeyPath}`, + ` username=${sshUser}` + + ` private_key=@${sshKeyPath}`, ); execSync( `vault policy write ${secretPolicyName} ./admin/tests/fixtures/kv-policy.hcl`, @@ -74,13 +74,13 @@ test('Vault Credential Store (User & Key Pair) @ce @aws @docker', async ({ const vaultToken = JSON.parse( execSync( `vault token create` + - ` -no-default-policy=true` + - ` -policy=${boundaryPolicyName}` + - ` -policy=${secretPolicyName}` + - ` -orphan=true` + - ` -period=20m` + - ` -renewable=true` + - ` -format=json`, + ` -no-default-policy=true` + + ` -policy=${boundaryPolicyName}` + + ` -policy=${secretPolicyName}` + + ` -orphan=true` + + ` -period=20m` + + ` -renewable=true` + + ` -format=json`, ), ); const clientToken = vaultToken.auth.client_token; @@ -90,9 +90,15 @@ test('Vault Credential Store (User & Key Pair) @ce @aws @docker', async ({ const projectsPage = new ProjectsPage(page); const projectName = await projectsPage.createProject(); const targetsPage = new TargetsPage(page); - const targetName = await targetsPage.createTargetWithAddress(targetAddress, targetPort); + const targetName = await targetsPage.createTargetWithAddress( + targetAddress, + targetPort, + ); const credentialStoresPage = new CredentialStoresPage(page); - await credentialStoresPage.createVaultCredentialStore(vaultAddr, clientToken); + await credentialStoresPage.createVaultCredentialStore( + vaultAddr, + clientToken, + ); const credentialLibraryName = 'Credential Library ' + nanoid(); await page.getByRole('link', { name: 'Credential Libraries' }).click(); diff --git a/e2e-tests/admin/tests/delete-resources-ent.spec.js b/e2e-tests/admin/tests/delete-resources-ent.spec.js index 88d235710..aa373fd22 100644 --- a/e2e-tests/admin/tests/delete-resources-ent.spec.js +++ b/e2e-tests/admin/tests/delete-resources-ent.spec.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: BUSL-1.1 */ -import { test } from '../playwright.config.js' +import { test } from '../playwright.config.js'; import { execSync } from 'node:child_process'; import { authenticatedState } from '../global-setup.js'; @@ -50,21 +50,18 @@ test.beforeAll(async () => { await checkVaultCli(); }); -test.beforeEach(async ({ - baseURL, - adminAuthMethodId, - adminLoginName, - adminPassword, -}) => { - execSync(`vault policy delete ${secretPolicyName}`); - execSync(`vault policy delete ${boundaryPolicyName}`); - await authenticateBoundaryCli( - baseURL, - adminAuthMethodId, - adminLoginName, - adminPassword, - ); -}); +test.beforeEach( + async ({ baseURL, adminAuthMethodId, adminLoginName, adminPassword }) => { + execSync(`vault policy delete ${secretPolicyName}`); + execSync(`vault policy delete ${boundaryPolicyName}`); + await authenticateBoundaryCli( + baseURL, + adminAuthMethodId, + adminLoginName, + adminPassword, + ); + }, +); test('Verify resources can be deleted (enterprise) @ent @aws', async ({ page, @@ -88,14 +85,25 @@ test('Verify resources can be deleted (enterprise) @ent @aws', async ({ let groupId = await createGroupCli(orgId); let userId = await createUserCli(orgId); let staticHostCatalogId = await createStaticHostCatalogCli(projectId); - let dynamicAwsHostCatalogId = await createDynamicAwsHostCatalogCli(projectId, awsRegion); + let dynamicAwsHostCatalogId = await createDynamicAwsHostCatalogCli( + projectId, + awsRegion, + ); let staticHostId = await createStaticHostCli(staticHostCatalogId); let staticHostSetId = await createHostSetCli(staticHostCatalogId); let staticCredentialStoreId = await createStaticCredentialStoreCli(projectId); - const vaultToken = await getVaultToken(boundaryPolicyName, secretPolicyName); - let vaultCredentialStoreId = await createVaultCredentialStoreCli(projectId, vaultAddr, vaultToken); - let usernamePasswordCredentialId = await createUsernamePasswordCredentialCli(staticCredentialStoreId); + const vaultToken = await getVaultToken( + boundaryPolicyName, + secretPolicyName, + ); + let vaultCredentialStoreId = await createVaultCredentialStoreCli( + projectId, + vaultAddr, + vaultToken, + ); + let usernamePasswordCredentialId = + await createUsernamePasswordCredentialCli(staticCredentialStoreId); let tcpTargetId = await createTcpTarget(projectId); // Create enterprise boundary resources using CLI diff --git a/e2e-tests/admin/tests/delete-resources.spec.js b/e2e-tests/admin/tests/delete-resources.spec.js index 9d8960754..63d8fd0f0 100644 --- a/e2e-tests/admin/tests/delete-resources.spec.js +++ b/e2e-tests/admin/tests/delete-resources.spec.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: BUSL-1.1 */ -import { test } from '../playwright.config.js' +import { test } from '../playwright.config.js'; import { execSync } from 'node:child_process'; import { authenticatedState } from '../global-setup.js'; @@ -49,21 +49,18 @@ test.beforeAll(async () => { await checkVaultCli(); }); -test.beforeEach(async ({ - baseURL, - adminAuthMethodId, - adminLoginName, - adminPassword, -}) => { - execSync(`vault policy delete ${secretPolicyName}`); - execSync(`vault policy delete ${boundaryPolicyName}`); - await authenticateBoundaryCli( - baseURL, - adminAuthMethodId, - adminLoginName, - adminPassword, - ); -}); +test.beforeEach( + async ({ baseURL, adminAuthMethodId, adminLoginName, adminPassword }) => { + execSync(`vault policy delete ${secretPolicyName}`); + execSync(`vault policy delete ${boundaryPolicyName}`); + await authenticateBoundaryCli( + baseURL, + adminAuthMethodId, + adminLoginName, + adminPassword, + ); + }, +); test('Verify resources can be deleted @ce @aws', async ({ page, @@ -86,12 +83,23 @@ test('Verify resources can be deleted @ce @aws', async ({ let groupId = await createGroupCli(orgId); let userId = await createUserCli(orgId); let staticHostCatalogId = await createStaticHostCatalogCli(projectId); - let dynamicAwsHostCatalogId = await createDynamicAwsHostCatalogCli(projectId, awsRegion); + let dynamicAwsHostCatalogId = await createDynamicAwsHostCatalogCli( + projectId, + awsRegion, + ); let staticHostId = await createStaticHostCli(staticHostCatalogId); let staticHostSetId = await createHostSetCli(staticHostCatalogId); - let staticCredentialStoreId = await createStaticCredentialStoreCli(projectId); - const vaultToken = await getVaultToken(boundaryPolicyName, secretPolicyName); - let vaultCredentialStoreId = await createVaultCredentialStoreCli(projectId, vaultAddr, vaultToken); + let staticCredentialStoreId = + await createStaticCredentialStoreCli(projectId); + const vaultToken = await getVaultToken( + boundaryPolicyName, + secretPolicyName, + ); + let vaultCredentialStoreId = await createVaultCredentialStoreCli( + projectId, + vaultAddr, + vaultToken, + ); let usernamePasswordCredentialId = await createUsernamePasswordCredentialCli(staticCredentialStoreId); let tcpTargetId = await createTcpTarget(projectId); diff --git a/e2e-tests/admin/tests/dynamic-host-catalog-aws.spec.js b/e2e-tests/admin/tests/dynamic-host-catalog-aws.spec.js index 7d88c7194..451e8576f 100644 --- a/e2e-tests/admin/tests/dynamic-host-catalog-aws.spec.js +++ b/e2e-tests/admin/tests/dynamic-host-catalog-aws.spec.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: BUSL-1.1 */ -import { test } from '../playwright.config.js' +import { test } from '../playwright.config.js'; import { expect } from '@playwright/test'; import { nanoid } from 'nanoid'; @@ -63,12 +63,8 @@ test.describe('AWS', async () => { .getByLabel('AWS') .click(); await page.getByLabel('AWS Region').fill(awsRegion); - await page - .getByLabel('Access Key ID') - .fill(awsAccessKeyId); - await page - .getByLabel('Secret Access Key') - .fill(awsSecretAccessKey); + await page.getByLabel('Access Key ID').fill(awsAccessKeyId); + await page.getByLabel('Secret Access Key').fill(awsSecretAccessKey); await page .getByLabel('Disable credential rotation') .click({ force: true }); diff --git a/e2e-tests/admin/tests/global-settings.spec.js b/e2e-tests/admin/tests/global-settings.spec.js index 5aa7465c1..6b165ce6b 100644 --- a/e2e-tests/admin/tests/global-settings.spec.js +++ b/e2e-tests/admin/tests/global-settings.spec.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: BUSL-1.1 */ -import { test } from '../playwright.config.js' +import { test } from '../playwright.config.js'; import { expect } from '@playwright/test'; import { authenticatedState } from '../global-setup.js'; diff --git a/e2e-tests/admin/tests/group-role.spec.js b/e2e-tests/admin/tests/group-role.spec.js index a71561455..643b49d34 100644 --- a/e2e-tests/admin/tests/group-role.spec.js +++ b/e2e-tests/admin/tests/group-role.spec.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: BUSL-1.1 */ -import { test } from '../playwright.config.js' +import { test } from '../playwright.config.js'; import { expect } from '@playwright/test'; import { authenticatedState } from '../global-setup.js'; diff --git a/e2e-tests/admin/tests/login.spec.js b/e2e-tests/admin/tests/login.spec.js index f2a6c6609..fa3f9c0f8 100644 --- a/e2e-tests/admin/tests/login.spec.js +++ b/e2e-tests/admin/tests/login.spec.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: BUSL-1.1 */ -import { test } from '../playwright.config.js' +import { test } from '../playwright.config.js'; import { expect } from '@playwright/test'; import { LoginPage } from '../pages/login.js'; @@ -42,16 +42,12 @@ test.describe('Failure Cases', async () => { page, adminLoginName, }) => { - await page - .getByLabel('Login Name') - .fill(adminLoginName); + await page.getByLabel('Login Name').fill(adminLoginName); await page.getByLabel('Password', { exact: true }).fill('badpassword'); await page.getByRole('button', { name: 'Sign In' }).click(); await expect(page.getByRole('alert').getByText('Error')).toBeVisible(); await expect(page.getByRole('button', { name: 'Sign In' })).toBeVisible(); - await expect( - page.getByText(adminLoginName), - ).toBeHidden(); + await expect(page.getByText(adminLoginName)).toBeHidden(); }); test('Log in with only username @ce @ent @aws @docker', async ({ @@ -62,9 +58,7 @@ test.describe('Failure Cases', async () => { await page.getByRole('button', { name: 'Sign In' }).click(); await expect(page.getByRole('alert').getByText('Error')).toBeVisible(); await expect(page.getByRole('button', { name: 'Sign In' })).toBeVisible(); - await expect( - page.getByText(adminLoginName), - ).toBeHidden(); + await expect(page.getByText(adminLoginName)).toBeHidden(); }); test('Log in with only password @ce @ent @aws @docker', async ({ @@ -72,14 +66,10 @@ test.describe('Failure Cases', async () => { adminLoginName, adminPassword, }) => { - await page - .getByLabel('Password', { exact: true }) - .fill(adminPassword); + await page.getByLabel('Password', { exact: true }).fill(adminPassword); await page.getByRole('button', { name: 'Sign In' }).click(); await expect(page.getByRole('alert').getByText('Error')).toBeVisible(); await expect(page.getByRole('button', { name: 'Sign In' })).toBeVisible(); - await expect( - page.getByText(adminLoginName), - ).toBeHidden(); + await expect(page.getByText(adminLoginName)).toBeHidden(); }); }); diff --git a/e2e-tests/admin/tests/pagination.spec.js b/e2e-tests/admin/tests/pagination.spec.js index 4ccf83f2e..c109541f4 100644 --- a/e2e-tests/admin/tests/pagination.spec.js +++ b/e2e-tests/admin/tests/pagination.spec.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: BUSL-1.1 */ -import { test } from '../playwright.config.js' +import { test } from '../playwright.config.js'; import { expect } from '@playwright/test'; import { authenticatedState } from '../global-setup.js'; diff --git a/e2e-tests/admin/tests/session-recording-aws-ent.spec.js b/e2e-tests/admin/tests/session-recording-aws-ent.spec.js index 4891e463b..2fdc0c020 100644 --- a/e2e-tests/admin/tests/session-recording-aws-ent.spec.js +++ b/e2e-tests/admin/tests/session-recording-aws-ent.spec.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: BUSL-1.1 */ -import { test } from '../playwright.config.js' +import { test } from '../playwright.config.js'; import { expect } from '@playwright/test'; import { execSync } from 'child_process'; @@ -97,12 +97,24 @@ test('Session Recording Test (AWS) @ent @aws', async ({ await page.getByRole('link', { name: orgName }).click(); await page.getByRole('link', { name: projectName }).click(); const targetsPage = new TargetsPage(page); - const targetName = await targetsPage.createSshTargetWithAddressEnt(targetAddress, targetPort); - await targetsPage.addEgressWorkerFilterToTarget(`"${workerTagEgress}" in "/tags/type"`); + const targetName = await targetsPage.createSshTargetWithAddressEnt( + targetAddress, + targetPort, + ); + await targetsPage.addEgressWorkerFilterToTarget( + `"${workerTagEgress}" in "/tags/type"`, + ); const credentialStoresPage = new CredentialStoresPage(page); await credentialStoresPage.createStaticCredentialStore(); - const credentialName = await credentialStoresPage.createStaticCredentialKeyPair(sshUser, sshKeyPath); - await targetsPage.addInjectedCredentialsToTarget(targetName, credentialName); + const credentialName = + await credentialStoresPage.createStaticCredentialKeyPair( + sshUser, + sshKeyPath, + ); + await targetsPage.addInjectedCredentialsToTarget( + targetName, + credentialName, + ); await page.getByRole('link', { name: targetName }).click(); await targetsPage.enableSessionRecording(storageBucketName); diff --git a/e2e-tests/admin/tests/session-recording-minio-ent.spec.js b/e2e-tests/admin/tests/session-recording-minio-ent.spec.js index c75670552..591a16ea8 100644 --- a/e2e-tests/admin/tests/session-recording-minio-ent.spec.js +++ b/e2e-tests/admin/tests/session-recording-minio-ent.spec.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: BUSL-1.1 */ -import { test } from '../playwright.config.js' +import { test } from '../playwright.config.js'; import { expect } from '@playwright/test'; import { execSync } from 'child_process'; @@ -100,14 +100,28 @@ test('Session Recording Test (MinIO) @ent @docker', async ({ await page.getByRole('link', { name: orgName }).click(); await page.getByRole('link', { name: projectName }).click(); const targetsPage = new TargetsPage(page); - const targetName = await targetsPage.createSshTargetWithAddressEnt(targetAddress, targetPort); - await targetsPage.addIngressWorkerFilterToTarget(`"${workerTagEgress}" in "/tags/type"`); - await targetsPage.addEgressWorkerFilterToTarget(`"${workerTagEgress}" in "/tags/type"`); + const targetName = await targetsPage.createSshTargetWithAddressEnt( + targetAddress, + targetPort, + ); + await targetsPage.addIngressWorkerFilterToTarget( + `"${workerTagEgress}" in "/tags/type"`, + ); + await targetsPage.addEgressWorkerFilterToTarget( + `"${workerTagEgress}" in "/tags/type"`, + ); const credentialStoresPage = new CredentialStoresPage(page); await credentialStoresPage.createStaticCredentialStore(); - const credentialName = await credentialStoresPage.createStaticCredentialKeyPair(sshUser, sshKeyPath); - await targetsPage.addInjectedCredentialsToTarget(targetName, credentialName); + const credentialName = + await credentialStoresPage.createStaticCredentialKeyPair( + sshUser, + sshKeyPath, + ); + await targetsPage.addInjectedCredentialsToTarget( + targetName, + credentialName, + ); await page.getByRole('link', { name: targetName }).click(); await targetsPage.enableSessionRecording(storageBucketName); diff --git a/e2e-tests/admin/tests/ssh-certificate-injection-vault-ent.spec.js b/e2e-tests/admin/tests/ssh-certificate-injection-vault-ent.spec.js index 9abc40499..52dd581ad 100644 --- a/e2e-tests/admin/tests/ssh-certificate-injection-vault-ent.spec.js +++ b/e2e-tests/admin/tests/ssh-certificate-injection-vault-ent.spec.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: BUSL-1.1 */ -import { test } from '../playwright.config.js' +import { test } from '../playwright.config.js'; import { expect } from '@playwright/test'; import { execSync } from 'child_process'; @@ -76,22 +76,22 @@ test('SSH Certificate Injection @ent @docker', async ({ execSync( `vault write ${secretsPath}/config/ca` + - ` private_key="${private_key}"` + - ` public_key="${public_key}"` + - ` generate_signing_key=false`, + ` private_key="${private_key}"` + + ` public_key="${public_key}"` + + ` generate_signing_key=false`, ` format=json`, ); const vaultToken = JSON.parse( execSync( `vault token create` + - ` -no-default-policy=true` + - ` -policy=${boundaryPolicyName}` + - ` -policy=${sshPolicyName}` + - ` -orphan=true` + - ` -period=20m` + - ` -renewable=true` + - ` -format=json`, + ` -no-default-policy=true` + + ` -policy=${boundaryPolicyName}` + + ` -policy=${sshPolicyName}` + + ` -orphan=true` + + ` -period=20m` + + ` -renewable=true` + + ` -format=json`, ), ); const clientToken = vaultToken.auth.client_token; @@ -106,11 +106,17 @@ test('SSH Certificate Injection @ent @docker', async ({ // Create target const targetsPage = new TargetsPage(page); - const targetName = await targetsPage.createSshTargetWithAddressEnt(targetAddress, targetPort); + const targetName = await targetsPage.createSshTargetWithAddressEnt( + targetAddress, + targetPort, + ); // Create credentials const credentialStoresPage = new CredentialStoresPage(page); - await credentialStoresPage.createVaultCredentialStore(vaultAddr, clientToken); + await credentialStoresPage.createVaultCredentialStore( + vaultAddr, + clientToken, + ); const credentialLibraryName = await credentialStoresPage.createVaultSshCertificateCredentialLibraryEnt( `${secretsPath}/issue/${secretName}`, diff --git a/e2e-tests/admin/tests/ssh-credential-injection-vault-ent.spec.js b/e2e-tests/admin/tests/ssh-credential-injection-vault-ent.spec.js index 7611ee697..1d4c2c88c 100644 --- a/e2e-tests/admin/tests/ssh-credential-injection-vault-ent.spec.js +++ b/e2e-tests/admin/tests/ssh-credential-injection-vault-ent.spec.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: BUSL-1.1 */ -import { test } from '../playwright.config.js' +import { test } from '../playwright.config.js'; import { expect } from '@playwright/test'; import { execSync } from 'child_process'; @@ -66,8 +66,8 @@ test('SSH Credential Injection (Vault User & Key Pair) @ent @docker', async ({ execSync(`vault secrets enable -path=${secretsPath} kv-v2`); execSync( `vault kv put -mount ${secretsPath} ${secretName} ` + - ` username=${sshUser}` + - ` private_key=@${sshKeyPath}`, + ` username=${sshUser}` + + ` private_key=@${sshKeyPath}`, ); execSync( `vault policy write ${secretPolicyName} ./admin/tests/fixtures/kv-policy.hcl`, @@ -75,13 +75,13 @@ test('SSH Credential Injection (Vault User & Key Pair) @ent @docker', async ({ const vaultToken = JSON.parse( execSync( `vault token create` + - ` -no-default-policy=true` + - ` -policy=${boundaryPolicyName}` + - ` -policy=${secretPolicyName}` + - ` -orphan=true` + - ` -period=20m` + - ` -renewable=true` + - ` -format=json`, + ` -no-default-policy=true` + + ` -policy=${boundaryPolicyName}` + + ` -policy=${secretPolicyName}` + + ` -orphan=true` + + ` -period=20m` + + ` -renewable=true` + + ` -format=json`, ), ); const clientToken = vaultToken.auth.client_token; @@ -96,17 +96,26 @@ test('SSH Credential Injection (Vault User & Key Pair) @ent @docker', async ({ // Create target const targetsPage = new TargetsPage(page); - const targetName = await targetsPage.createSshTargetWithAddressEnt(targetAddress, targetPort); + const targetName = await targetsPage.createSshTargetWithAddressEnt( + targetAddress, + targetPort, + ); // Create credentials const credentialStoresPage = new CredentialStoresPage(page); - await credentialStoresPage.createVaultCredentialStore(vaultAddr, clientToken); + await credentialStoresPage.createVaultCredentialStore( + vaultAddr, + clientToken, + ); const credentialLibraryName = await credentialStoresPage.createVaultGenericCredentialLibraryEnt( `${secretsPath}/data/${secretName}`, 'SSH Private Key', ); - await targetsPage.addInjectedCredentialsToTarget(targetName, credentialLibraryName); + await targetsPage.addInjectedCredentialsToTarget( + targetName, + credentialLibraryName, + ); // Connect to target await authenticateBoundaryCli( diff --git a/e2e-tests/admin/tests/target-ent.spec.js b/e2e-tests/admin/tests/target-ent.spec.js index 7f2f78659..9590077a2 100644 --- a/e2e-tests/admin/tests/target-ent.spec.js +++ b/e2e-tests/admin/tests/target-ent.spec.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: BUSL-1.1 */ -import { test } from '../playwright.config.js' +import { test } from '../playwright.config.js'; import { expect } from '@playwright/test'; import { authenticatedState } from '../global-setup.js'; @@ -50,7 +50,10 @@ test('Verify session created for TCP target @ent @aws @docker', async ({ const projectsPage = new ProjectsPage(page); const projectName = await projectsPage.createProject(); const targetsPage = new TargetsPage(page); - const targetName = await targetsPage.createTcpTargetWithAddressEnt(targetAddress, targetPort); + const targetName = await targetsPage.createTcpTargetWithAddressEnt( + targetAddress, + targetPort, + ); await authenticateBoundaryCli( baseURL, @@ -100,12 +103,21 @@ test('Verify session created for SSH target @ent @aws @docker', async ({ const projectsPage = new ProjectsPage(page); const projectName = await projectsPage.createProject(); const targetsPage = new TargetsPage(page); - const targetName = await targetsPage.createSshTargetWithAddressEnt(targetAddress, targetPort); + const targetName = await targetsPage.createSshTargetWithAddressEnt( + targetAddress, + targetPort, + ); const credentialStoresPage = new CredentialStoresPage(page); await credentialStoresPage.createStaticCredentialStore(); const credentialName = - await credentialStoresPage.createStaticCredentialKeyPair(sshUser, sshKeyPath); - await targetsPage.addInjectedCredentialsToTarget(targetName, credentialName); + await credentialStoresPage.createStaticCredentialKeyPair( + sshUser, + sshKeyPath, + ); + await targetsPage.addInjectedCredentialsToTarget( + targetName, + credentialName, + ); await authenticateBoundaryCli( baseURL, @@ -192,8 +204,15 @@ test('SSH target with host sources @ent @aws @docker', async ({ // Create credentials and attach to target const credentialStoresPage = new CredentialStoresPage(page); await credentialStoresPage.createStaticCredentialStore(); - const credentialName = await credentialStoresPage.createStaticCredentialKeyPair(sshUser, sshKeyPath); - await targetsPage.addInjectedCredentialsToTarget(targetName, credentialName); + const credentialName = + await credentialStoresPage.createStaticCredentialKeyPair( + sshUser, + sshKeyPath, + ); + await targetsPage.addInjectedCredentialsToTarget( + targetName, + credentialName, + ); // Connect to target await authenticateBoundaryCli( diff --git a/e2e-tests/admin/tests/target.spec.js b/e2e-tests/admin/tests/target.spec.js index 5c7687f79..5c9b1b710 100644 --- a/e2e-tests/admin/tests/target.spec.js +++ b/e2e-tests/admin/tests/target.spec.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: BUSL-1.1 */ -import { test } from '../playwright.config.js' +import { test } from '../playwright.config.js'; import { expect } from '@playwright/test'; import { authenticatedState } from '../global-setup.js'; @@ -121,7 +121,10 @@ test('Verify session created to target with address, then cancel the session @ce const projectsPage = new ProjectsPage(page); const projectName = await projectsPage.createProject(); const targetsPage = new TargetsPage(page); - const targetName = await targetsPage.createTargetWithAddress(targetAddress, targetPort); + const targetName = await targetsPage.createTargetWithAddress( + targetAddress, + targetPort, + ); await authenticateBoundaryCli( baseURL, @@ -208,7 +211,7 @@ test('Verify TCP target is updated @ce @aws @docker', async ({ await expect(page.getByText('"dev" in "/tags/type"')).toBeVisible(); await page.getByRole('textbox').click({ force: true }); - await page.keyboard.press("Meta+A"); + await page.keyboard.press('Meta+A'); await page.keyboard.press('Backspace'); await page.getByRole('textbox').fill('"prod" in "/tags/type"'); await page.getByRole('button', { name: 'Save' }).click(); diff --git a/e2e-tests/admin/tests/worker-ent.spec.js b/e2e-tests/admin/tests/worker-ent.spec.js index 94f15c3bc..492472c80 100644 --- a/e2e-tests/admin/tests/worker-ent.spec.js +++ b/e2e-tests/admin/tests/worker-ent.spec.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: BUSL-1.1 */ -import { test } from '../playwright.config.js' +import { test } from '../playwright.config.js'; import { expect } from '@playwright/test'; import { authenticatedState } from '../global-setup.js'; diff --git a/e2e-tests/admin/tests/worker-tags.spec.js b/e2e-tests/admin/tests/worker-tags.spec.js index 53e8c5bf7..a3a5bd2fe 100644 --- a/e2e-tests/admin/tests/worker-tags.spec.js +++ b/e2e-tests/admin/tests/worker-tags.spec.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: BUSL-1.1 */ -import { test } from '../playwright.config.js' +import { test } from '../playwright.config.js'; import { expect } from '@playwright/test'; import { customAlphabet } from 'nanoid'; @@ -21,9 +21,7 @@ test('Worker Tags @ce @ent @aws @docker', async ({ page }) => { .getByRole('link', { name: 'Workers' }) .click(); await expect( - page - .getByRole('navigation', { name: 'breadcrumbs' }) - .getByText('Workers'), + page.getByRole('navigation', { name: 'breadcrumbs' }).getByText('Workers'), ).toBeVisible(); // View tags from worker list page @@ -82,9 +80,12 @@ test('Worker Tags @ce @ent @aws @docker', async ({ page }) => { .getByRole('row') .nth(1) .getByRole('cell') - .nth(dialogTypeIndex) - ).toHaveText('config') - await page.getByRole('dialog').getByRole('button', { name: 'Dismiss' }).click(); + .nth(dialogTypeIndex), + ).toHaveText('config'); + await page + .getByRole('dialog') + .getByRole('button', { name: 'Dismiss' }) + .click(); // Go to worker details and create a new tag await page @@ -106,9 +107,7 @@ test('Worker Tags @ce @ent @aws @docker', async ({ page }) => { .getByRole('link', { name: 'Workers' }) .click(); await expect( - page - .getByRole('navigation', { name: 'breadcrumbs' }) - .getByText('Workers'), + page.getByRole('navigation', { name: 'breadcrumbs' }).getByText('Workers'), ).toBeVisible(); await page .getByRole('table') @@ -122,9 +121,12 @@ test('Worker Tags @ce @ent @aws @docker', async ({ page }) => { page .getByRole('dialog') .getByRole('table') - .getByRole('cell', { name: tagKey + " = " + tagValue }) + .getByRole('cell', { name: tagKey + ' = ' + tagValue }), ).toBeVisible(); - await page.getByRole('dialog').getByRole('button', { name: 'Dismiss' }).click(); + await page + .getByRole('dialog') + .getByRole('button', { name: 'Dismiss' }) + .click(); // Go to worker details page await page @@ -165,14 +167,14 @@ test('Worker Tags @ce @ent @aws @docker', async ({ page }) => { .getByRole('row') .nth(1) .getByRole('cell') - .nth(workerDetailsTypeIndex) + .nth(workerDetailsTypeIndex), ).toHaveText('config'); await expect( page .getByRole('table') .getByRole('cell', { name: tagKey }) .locator('..') - .getByRole('cell', { name: tagValue }) + .getByRole('cell', { name: tagValue }), ).toBeVisible(); // Edit the tag @@ -184,14 +186,12 @@ test('Worker Tags @ce @ent @aws @docker', async ({ page }) => { .getByRole('table') .getByRole('cell', { name: newTagKey }) .locator('..') - .getByRole('cell', { name: newTagValue }) + .getByRole('cell', { name: newTagValue }), ).toBeVisible(); // Delete the tag await workersPage.removeTag(newTagKey); await expect( - page - .getByRole('table') - .getByRole('cell', { name: newTagKey }) + page.getByRole('table').getByRole('cell', { name: newTagKey }), ).not.toBeVisible(); }); diff --git a/e2e-tests/admin/tests/worker.spec.js b/e2e-tests/admin/tests/worker.spec.js index 2746cea53..906a49316 100644 --- a/e2e-tests/admin/tests/worker.spec.js +++ b/e2e-tests/admin/tests/worker.spec.js @@ -3,7 +3,7 @@ * SPDX-License-Identifier: BUSL-1.1 */ -import { test } from '../playwright.config.js' +import { test } from '../playwright.config.js'; import { expect } from '@playwright/test'; import { authenticatedState } from '../global-setup.js'; diff --git a/e2e-tests/desktop/fixtures/baseTest.js b/e2e-tests/desktop/fixtures/baseTest.js index 643ce1620..b10106447 100644 --- a/e2e-tests/desktop/fixtures/baseTest.js +++ b/e2e-tests/desktop/fixtures/baseTest.js @@ -10,4 +10,4 @@ import { authenticateTest } from './authenticateTest.js'; // Redundant since authenticateTest already extends electronTest but this is for demonstration purposes // The last item in the list will override any previous ones in a fixture name collision export const test = mergeTests(authenticateTest, electronTest); -export { expect } from '@playwright/test'; \ No newline at end of file +export { expect } from '@playwright/test'; diff --git a/e2e-tests/desktop/pages/loginPage.js b/e2e-tests/desktop/pages/loginPage.js index 15a3dcd06..246ec50d9 100644 --- a/e2e-tests/desktop/pages/loginPage.js +++ b/e2e-tests/desktop/pages/loginPage.js @@ -29,4 +29,4 @@ export default class LoginPage { } // Can't login with OIDC as we can't control the external browser that is opened -} \ No newline at end of file +} diff --git a/e2e-tests/desktop/tests/authentication.spec.js b/e2e-tests/desktop/tests/authentication.spec.js index 2959c8e90..e04ca9a8a 100644 --- a/e2e-tests/desktop/tests/authentication.spec.js +++ b/e2e-tests/desktop/tests/authentication.spec.js @@ -3,8 +3,8 @@ * SPDX-License-Identifier: BUSL-1.1 */ -import { expect, test } from "../fixtures/baseTest.js"; -import LoginPage from "../pages/loginPage.js"; +import { expect, test } from '../fixtures/baseTest.js'; +import LoginPage from '../pages/loginPage.js'; test.describe('user/password authentication tests', async () => { test('Authenticates and signs out', async ({