Skip to content

Commit 47b6d0c

Browse files
fix staging e2e testing (#156)
* fix staging e2e testing * remove staging e2e debugging on feature branch
1 parent c46bcfb commit 47b6d0c

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

components/form/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ const Form = () => {
123123
/>
124124
<Button
125125
{...{
126-
'data-test-id': 'submitApplicationButton',
127126
onClick,
128127
}}
129128
>

pages/index.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const Home = () => (
3434
Commit is designing the future of work and we're putting Engineers
3535
at the center.
3636
</Text>
37-
<ApplyLink data-test-id='applyButton'>Apply to Join Us</ApplyLink>
37+
<ApplyLink>Apply to Join Us</ApplyLink>
3838
</div>
3939
<div className={styles.heroSvg}>
4040
<BracketSvg />
@@ -148,9 +148,10 @@ const Home = () => (
148148
The Commit Platform
149149
</Heading>
150150
<Text sectionText>
151-
The Commit Platform replaces the technical interview with deep backgrounds,
152-
matches Software Engineers with relevant startups, and connect Engineers
153-
with peers for interest sharing or technical support.
151+
The Commit Platform replaces the technical interview with deep
152+
backgrounds, matches Software Engineers with relevant startups, and
153+
connect Engineers with peers for interest sharing or technical
154+
support.
154155
</Text>
155156
</div>
156157
<div className={styles.platformFlex}>
@@ -174,11 +175,12 @@ const Home = () => (
174175
</div>
175176
<div className={styles.profileColumnRight}>
176177
<Heading variant={h3} className={styles.platformTitle}>
177-
Platform profile
178+
Platform profile
178179
</Heading>
179180
<Text sectionText className={styles.platformDescription}>
180-
Get the latest community events, news and updates. Most importantly, begin to look for startup
181-
opportunities recommended specifically for you. This is also where engineers begin to
181+
Get the latest community events, news and updates. Most
182+
importantly, begin to look for startup opportunities recommended
183+
specifically for you. This is also where engineers begin to
182184
connect with their peers and join interest-based groups.
183185
</Text>
184186
</div>
@@ -267,4 +269,3 @@ const Home = () => (
267269
)
268270

269271
export default Home
270-

tests/index.e2e.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,29 @@ import puppeteer from 'puppeteer'
22

33
import { config, PageObjectModel } from '../helpers/e2e'
44

5+
const APPLY_SELECTOR = '[href="/apply"]'
6+
const SUBMIT_APPLICATION_SELECTOR = 'form button'
57
class LandingPage extends PageObjectModel {
68
async checkApplyButtonExists() {
79
const buttonText = await this.getTextBySelector({
8-
selector: '[data-test-id="applyButton"]',
10+
selector: APPLY_SELECTOR,
911
})
1012
await expect(buttonText).toBeTruthy()
1113
}
1214
}
1315

1416
describe('LandingPage', () => {
1517
let browser
18+
let context
1619
let page
1720
let landingPage
1821
const filenamePrefix = 'landing'
1922

2023
beforeAll(async () => {
2124
browser = await puppeteer.launch(config.puppeteer)
22-
page = await browser.newPage()
25+
context = await browser.createIncognitoBrowserContext()
26+
page = await context.newPage()
27+
console.log('Host: ', config.host)
2328
landingPage = new LandingPage(page)
2429
})
2530

@@ -37,10 +42,10 @@ describe('LandingPage', () => {
3742

3843
it('it goes to the apply page on click of apply button', async () => {
3944
await landingPage.clickSelector({
40-
selector: '[data-test-id="applyButton"]',
45+
selector: APPLY_SELECTOR,
4146
})
4247
const buttonText = await landingPage.getTextBySelector({
43-
selector: '[data-test-id="submitApplicationButton"]',
48+
selector: SUBMIT_APPLICATION_SELECTOR,
4449
})
4550
expect(buttonText).toBeTruthy()
4651
await landingPage.saveScreenshot({

0 commit comments

Comments
 (0)