Add swarmpit.nixc.us-login.test.ts

This commit is contained in:
colin 2023-11-22 02:39:52 +00:00
parent e1b30e3c8f
commit 24bcdce55b
1 changed files with 27 additions and 0 deletions

View File

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