Skip to content

Commit

Permalink
change tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergio Beltrán committed Jun 4, 2024
1 parent da257f0 commit aeada65
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 17 deletions.
9 changes: 0 additions & 9 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,6 @@ jobs:
- name: Check Docker logs
run: docker-compose logs

- name: Print home page
run: curl http://localhost:8080

- name: Check Docker logs
run: docker-compose logs

- name: Print product page
run: curl https://ruxailab-dev.web.app

- name: Install npm dependencies
run: npm ci

Expand Down
8 changes: 4 additions & 4 deletions e2e/ruxailabtest.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ const createTest = async (page, type) => {
}

test('has link page', async ({ page }) => {
await page.goto('/')
await page.goto('http://localhost:8080/signin')

// Esperar un elemento específico
await page.waitForSelector('#app', { timeout: 20000 });
await page.waitForSelector('#app', { timeout: 20000 })

// Tomar una captura de pantalla para verificar el estado de la página
await page.screenshot({ path: 'screenshot.png' });
await page.screenshot({ path: 'screenshot.png' })

// Ahora verificar el título de la página
await expect(page).toHaveTitle(/RUXAILAB/, { timeout: 20000 });
await expect(page).toHaveTitle(/RUXAILAB/, { timeout: 20000 })
})

// test('sign and create heurisic test', async ({ page }) => {
Expand Down
29 changes: 25 additions & 4 deletions playwright.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @ts-check
const { defineConfig, devices } = require('@playwright/test')
const { defineConfig, devices } = require('@playwright/test');

const devBaseUrl = 'http://localhost:8080'
const devBaseUrl = 'http://localhost:8080';

module.exports = defineConfig({
testDir: './e2e',
Expand All @@ -22,24 +22,45 @@ module.exports = defineConfig({

/* Output directory for screenshots of failed tests */
outputDir: './playwright/output',

use: {
baseURL: devBaseUrl,
...devices['Desktop Chrome'],
/* Collect trace when retrying the failed test */
trace: 'on-first-retry',

/* Create a screenshot if a test fails */
screenshot: { mode: 'only-on-failure', fullPage: true },

/* Set global timeout for actions (e.g., click, fill) */
actionTimeout: 10000,

/* Set global timeout for navigation */
navigationTimeout: 30000,
},

/* Configure projects for major browsers */
projects: [
{
name: 'chromium',
use: {
baseURL: devBaseUrl,
...devices['Desktop Chrome'],
},
retries: 1,
},
{
name: 'firefox',
use: {
...devices['Desktop Firefox'],
},
retries: 1,
},
{
name: 'webkit',
use: {
...devices['Desktop Safari'],
},
retries: 1,
},
],
})
});

0 comments on commit aeada65

Please sign in to comment.