-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8f04be0
commit 3136802
Showing
2 changed files
with
27 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { expect } from "@playwright/test" | ||
|
||
class PerfilPage{ | ||
|
||
constructor(page){ | ||
this.page = page | ||
this.extenderBio = "//button[contains(.,'Ver mais')]" | ||
this.reduzirBio = "//button[contains(.,'Ver menos')]" | ||
this.estilosPreferidos = "(//h1[contains(.,'Estilos preferidos')])[1]" | ||
this.conquistas = "(//h1[contains(.,'Conquistas')])[1]" | ||
} | ||
|
||
async conferirElementosTela(){ | ||
await this.page.click(this.extenderBio) | ||
await this.page.click(this.reduzirBio) | ||
|
||
await expect(this.page.locator(this.estilosPreferidos)).toBeVisible() | ||
await expect(this.page.locator(this.conquistas)).toBeVisible() | ||
} | ||
}; | ||
|
||
export default PerfilPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,10 @@ | ||
const { test, expect } = require('@playwright/test'); | ||
import PerfilPage from '../pages/PerfilPage'; | ||
|
||
test('acessar perfil', async ({ page }) => { | ||
test('Acessar Perfil', async ({ page }) => { | ||
await page.goto('https://frontend-nnf7bytugq-uc.a.run.app/user/profile?show=profile'); | ||
|
||
await expect(page).toHaveTitle(/Tem Vaga Mestre/); | ||
|
||
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(); | ||
}); | ||
const perfilPage = new PerfilPage(page) | ||
|
||
await perfilPage.conferirElementosTela() | ||
}); |