Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: cta to purchase the course #60

Merged
merged 9 commits into from
Dec 26, 2021
Prev Previous commit
Next Next commit
fix: change page.fill to getByRole
retry19 committed Dec 26, 2021
commit 70b763364c04acd6e177c00ed3a05736d33f7651
30 changes: 24 additions & 6 deletions e2e/settings.spec.ts
Original file line number Diff line number Diff line change
@@ -77,15 +77,33 @@ test('Validate name when updating data', async ({
).not.toBeVisible()
})

test('Update profile', async ({ page }) => {
test('Update profile', async ({ page, queries: { getByRole } }) => {
await page.goto('/dashboard/settings')

await page.fill('[name="name"]', 'Lorem Ipsum')
await page.fill('[name="phoneNumber"]', '+6289123456')
await page.fill('[name="telegram"]', '@lorem_tl')
await page.fill('[name="instagram"]', '@lorem_ig')
// Get element by role
const name = await getByRole('textbox', {
name: /nama lengkap/i,
})
const phoneNumber = await getByRole('textbox', {
name: /nomor whatsapp/i,
})
const telegram = await getByRole('textbox', {
name: /username telegram/i,
})
const instagram = await getByRole('textbox', {
name: /username instagram/i,
})
const saveButton = await getByRole('button', {
name: /simpan/i,
})

await page.click('text=Simpan')
// Fill all input
await name.fill('Lorem Ipsum')
await phoneNumber.fill('+6289123456')
await telegram.fill('@lorem_tl')
await instagram.fill('@lorem_ig')

await saveButton.click()

// Reload page to make sure getting the latest user data
await page.reload()