-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.e2e.js
More file actions
36 lines (31 loc) · 914 Bytes
/
index.e2e.js
File metadata and controls
36 lines (31 loc) · 914 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import puppeteer from 'puppeteer'
import { config, PageObjectModel } from '../helpers/e2e'
class LandingPage extends PageObjectModel {
async checkApplyButtonExists() {
const buttonText = await this.getTextBySelector({
selector: '[data-test-id="button"]',
})
await expect(buttonText).toBeTruthy()
}
}
describe('LandingPage', () => {
let browser
let page
let landingPage
const filenamePrefix = 'landing'
beforeAll(async () => {
browser = await puppeteer.launch(config.puppeteer)
page = await browser.newPage()
landingPage = new LandingPage(page)
})
afterAll(async () => {
await browser.close()
})
it('renders the apply button', async () => {
await landingPage.goToUrl({ url: config.host })
await landingPage.checkApplyButtonExists()
await landingPage.saveScreenshot({
filename: `${filenamePrefix}_00_landing_page_button`,
})
})
})