diff --git a/swarmpit.nixc.us-login.test.ts b/swarmpit.nixc.us-login.test.ts new file mode 100644 index 0000000..2da5c2a --- /dev/null +++ b/swarmpit.nixc.us-login.test.ts @@ -0,0 +1,27 @@ +import { test, expect } from '@playwright/test'; + +test('test', async ({ page }) => { + // Access environment variables for the username and password + const username = process.env.SWARM_USERNAME; + const password = process.env.SWARM_PASSWORD; + + // Ensure that the environment variables are defined + if (!username || !password) { + throw new Error('Swarm username or password environment variables are not set.'); + } + + await page.goto('https://swarmpit.nixc.us/'); + await page.getByLabel('Username *').click(); + await page.getByLabel('Username *').fill(username); // Use the environment variable for username + await page.getByLabel('Username *').press('Tab'); + await page.getByLabel('Password *').click(); + await page.getByLabel('Password *').fill(password); // Use the environment variable for password + await page.getByRole('button', { name: 'Sign in' }).click(); + await page.getByRole('link', { name: 'Registries' }).click(); + await page.getByRole('link', { name: 'Stacks' }).click(); + await page.getByPlaceholder('Search stacks ...').click(); + await page.getByPlaceholder('Search stacks ...').fill('swarmpit'); + await page.getByRole('link', { name: 'swarmpit' }).click(); + await page.getByRole('button', { name: 't' }).click(); + await page.getByText('Sign out').click(); +});