Skip to content

Commit

Permalink
Merge pull request #3 from Quest-Finder/add-baseUrl-config
Browse files Browse the repository at this point in the history
Add base url config
  • Loading branch information
brunomachadors authored May 14, 2024
2 parents 8f04be0 + ce481a0 commit b9d7cbd
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 25 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ node_modules/
/playwright-report/
/blob-report/
/playwright/.cache/
.env
2 changes: 1 addition & 1 deletion playwright.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module.exports = defineConfig({
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
// baseURL: 'http://127.0.0.1:3000',
baseURL: 'https://frontend-nnf7bytugq-uc.a.run.app/',

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
Expand Down
19 changes: 0 additions & 19 deletions tests/example.spec.js

This file was deleted.

12 changes: 7 additions & 5 deletions tests/perfil.spec.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
const { test, expect } = require('@playwright/test');
const { PATH } = require('../utils/constants');

test('acessar perfil', async ({ page }) => {
await page.goto('https://frontend-nnf7bytugq-uc.a.run.app/user/profile?show=profile');
await page.goto(PATH.perfil);

await expect(page).toHaveTitle(/Tem Vaga Mestre/);

await expect(page.getByRole('heading', { name: 'Estilos preferidos' })).toBeVisible();
await expect(
page.getByRole('heading', { name: 'Estilos preferidos' })
).toBeVisible();
await expect(page.getByRole('heading', { name: 'Conquistas' })).toBeVisible();

await page.getByRole('button', { name: 'Ver mais'}).click();
await page.getByRole('button', { name: 'Ver mais' }).click();
});

3 changes: 3 additions & 0 deletions utils/constants.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const PATH = {
perfil: '/user/profile?show=profile',
};

0 comments on commit b9d7cbd

Please sign in to comment.