open-nomad/e2e/ui/tests/example.spec.js
Tim Gross 2ad9f6bc5f
E2E: playwright configuration and smoke test (#12721)
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.
2022-04-21 09:13:10 -04:00

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();
});