2ad9f6bc5f
Scripts for running playwright tests in a Docker container that has chromium and webkit preinstalled. Includes a basic smoke test for authentication so that we can be sure the test rig is working end-to-end. Wiring this up in CI will be in an upcoming PR.
20 lines
547 B
JavaScript
20 lines
547 B
JavaScript
const { test, expect } = require('@playwright/test');
|
|
|
|
test('authenticated users can see their policies', async ({ page }) => {
|
|
|
|
var NOMAD_ADDR = process.env.NOMAD_ADDR;
|
|
if (NOMAD_ADDR == undefined || NOMAD_ADDR == "") {
|
|
NOMAD_ADDR = 'http://localhost:4646';
|
|
}
|
|
|
|
await page.goto(NOMAD_ADDR+'/ui/settings/tokens');
|
|
|
|
// smoke test that we reached the page
|
|
const logo = page.locator('div.navbar-brand');
|
|
await expect(logo).toBeVisible();
|
|
|
|
|
|
const policies = page.locator('text=Policies')
|
|
await expect(policies).toBeVisible();
|
|
});
|