Skip to content

Commit

Permalink
Parametrized base url for all tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zlatanjakic committed Jun 2, 2024
1 parent bded608 commit 5f1f8f5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions e2e/ruxailabtest.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const { test, expect } = require('@playwright/test')
const { log } = require('console')

const logIn = async (page) => {
await page.goto('http://localhost:5000/signin')
await page.goto('/signin')

await page.getByLabel('E-mail').fill('[email protected]')
await page.getByLabel('Password', { exact: true }).fill('password123')
Expand Down Expand Up @@ -130,7 +130,7 @@ test('Detalte test', async ({ page }) => {
'.console-button.mx-1.hidden-sm-and-down.v-btn.v-btn--text.theme--dark.v-size--default',
)

await page.goto('https://ruxailab-prod.web.app/testslist')
await page.goto('/testslist')

await page.click('text=Test heuristic playwright for delate')
await page.click(
Expand Down
15 changes: 9 additions & 6 deletions playwright.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// @ts-check
const { defineConfig, devices } = require('@playwright/test')

const devBaseUrl = 'http://localhost:5000'
const prodBaseUrl = 'https://ruxailab-prod.web.app'

module.exports = defineConfig({
testDir: './e2e',
/* Run tests in files in parallel */
Expand Down Expand Up @@ -36,15 +39,15 @@ module.exports = defineConfig({
{
name: 'chromium-dev',
use: {
baseURL: 'https://ruxailab-dev.web.app',
baseURL: devBaseUrl,
...devices['Desktop Chrome'],
},
retries: 1,
},
{
name: 'chromium-prod',
use: {
baseURL: 'https://ruxailab-prod.web.app',
baseURL: prodBaseUrl,
...devices['Desktop Chrome'],
},
retries: 0,
Expand All @@ -53,15 +56,15 @@ module.exports = defineConfig({
{
name: 'firefox-dev',
use: {
baseURL: 'https://ruxailab-dev.web.app',
baseURL: devBaseUrl,
...devices['Desktop Firefox'],
},
retries: 1,
},
{
name: 'firefox-prod',
use: {
baseURL: 'https://ruxailab-prod.web.app',
baseURL: prodBaseUrl,
...devices['Desktop Firefox'],
},
retries: 0,
Expand All @@ -70,13 +73,13 @@ module.exports = defineConfig({
{
name: 'webkit-dev',
use: {
baseURL: 'https://ruxailab-dev.web.app',
baseURL: devBaseUrl,
...devices['Desktop Safari'],
},
retries: 1,
},
{
name: 'webkit-prod',
name: prodBaseUrl,
use: {
baseURL: 'https://ruxailab-prod.web.app',
...devices['Desktop Safari'],
Expand Down

0 comments on commit 5f1f8f5

Please sign in to comment.