* feat: 🎸 Setup initial desktop E2E tests ✅ Closes: https://hashicorp.atlassian.net/browse/ICU-14061
38 lines
1.1 KiB
JavaScript
38 lines
1.1 KiB
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
const { test } = require('./fixtures/baseTest');
|
|
const { expect } = require('@playwright/test');
|
|
|
|
test.describe('Targets test', async () => {
|
|
test('Connects to a target and ends session', async ({ authedPage }) => {
|
|
await authedPage
|
|
.getByRole('link', { name: 'Generated target with a direct address' })
|
|
.click();
|
|
|
|
await authedPage.getByRole('button', { name: 'Connect' }).click();
|
|
|
|
await expect(authedPage).toHaveURL(
|
|
/.*\/scopes\/global\/projects\/sessions/,
|
|
);
|
|
|
|
await authedPage.getByRole('button', { name: 'End Session' }).click();
|
|
await expect(authedPage.getByText('Canceled successfully.')).toBeVisible();
|
|
await expect(authedPage).toHaveURL(
|
|
/.*\/scopes\/global\/projects\/targets$/,
|
|
);
|
|
});
|
|
|
|
test('Searches targets correctly', async ({ authedPage }) => {
|
|
await authedPage.getByLabel('Search').fill('hashicorp');
|
|
|
|
// One row is the header
|
|
await expect(authedPage.getByRole('row')).toHaveCount(2);
|
|
await expect(
|
|
authedPage.getByRole('link', { name: 'www.hashicorp.com' }),
|
|
).toBeVisible();
|
|
});
|
|
});
|