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

28 lines
1.3 KiB
TypeScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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