Skip to content

Simplify setup; example login spec#2

Merged
munderseth merged 1 commit into
mainfrom
initial-tests
Jun 3, 2026
Merged

Simplify setup; example login spec#2
munderseth merged 1 commit into
mainfrom
initial-tests

Conversation

@munderseth

@munderseth munderseth commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Updates to setup.
Added a initial login component.

@munderseth munderseth marked this pull request as ready for review June 3, 2026 15:41
Copilot AI review requested due to automatic review settings June 3, 2026 15:41
@munderseth munderseth merged commit 6a0d37a into main Jun 3, 2026
3 checks passed
@munderseth munderseth deleted the initial-tests branch June 3, 2026 15:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR streamlines the repository setup and CI configuration while adding an initial reusable login “component” plus a corresponding example spec to exercise it in Playwright.

Changes:

  • Simplify local setup guidance and scripts (README + package.json).
  • Update Playwright configuration defaults and require BASE_URL at config load time.
  • Add a login helper (loginComponent) and a new login check spec; wire CI to provide BASE_URL/PASSWORD.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
tests/hello-world.spec.js Simplifies the smoke test assertion for non-Example-Domain targets.
tests/components/login-component.js Adds a login helper that navigates, fills credentials, and submits.
tests/components/checks/login.spec.js Adds an example spec that invokes the login helper.
README.md Reworks setup instructions and clarifies how to set target URL.
playwright.config.js Simplifies config and enforces BASE_URL as required.
package.json Simplifies scripts by removing headed/debug helpers and browser install script.
.github/workflows/ci.yml Passes BASE_URL/PASSWORD into test step; ensures Testspace steps run with always().
.env.example Updates example BASE_URL and adds PASSWORD.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/hello-world.spec.js
Comment on lines 3 to 6
test('hello world smoke test', async ({ page }) => {
await page.goto('/');
await expect(page).toHaveTitle(/Example Domain/);
await expect(page.getByRole('heading', { name: 'Example Domain' })).toBeVisible();
await expect(page).toHaveTitle(/.+/);
}); No newline at end of file
Comment on lines +7 to +9
process.env.BASE_URL = process.env.BASE_URL || 'https://s2testorg.stridespace.com';
process.env.PASSWORD = process.env.PASSWORD || '';
await loginComponent(page);
@@ -0,0 +1,12 @@
const { test, expect } = require('@playwright/test');
Comment on lines +15 to +18
const BASE_URL = process.env.BASE_URL;
if (!BASE_URL) throw new Error('Environment variable BASE_URL is required but not defined');
const PASSWORD = process.env.PASSWORD;
if (!PASSWORD) throw new Error('Environment variable PASSWORD is required but not defined');
Comment on lines +23 to +25
// Step 2: Click on username or email address
// Step 3: Enter 'testuser' in username or email address
await page.getByPlaceholder('username or email address').fill('testuser');
Comment thread .env.example
Comment on lines +1 to +2
BASE_URL=https://s2testorg.stridespace.com
PASSWORD=testuser No newline at end of file
Comment thread README.md
Comment on lines 113 to 116
## Changing the target URL

The sample test uses `BASE_URL` and defaults to `https://example.com`.

You can store it in a `.env` file:
`BASE_URL` must be set before running tests. Set it in your `.env` file:

Comment thread playwright.config.js
Comment on lines 9 to +13
module.exports = defineConfig({
testDir: './tests',
timeout: 30_000,
fullyParallel: true,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
timeout: 60000,
retries: 0,
workers: 1,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants