generated from Arquisoft/dede_0
-
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.
Merge pull request #196 from Arquisoft/e2e_gaspar
e2e gaspar
- Loading branch information
Showing
5 changed files
with
111 additions
and
1 deletion.
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,6 @@ | ||
Feature: Consulting documentation | ||
|
||
Scenario: User consults project documentation | ||
Given A user who founds the site | ||
When selects the documentation button on the footer | ||
Then is redirected to the documentation web page |
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,6 @@ | ||
Feature: Consulting source code | ||
|
||
Scenario: User consults project source code | ||
Given A user who founds the site | ||
When selects the source code button on the footer | ||
Then is redirected to GitHub |
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
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,49 @@ | ||
import { defineFeature, loadFeature } from 'jest-cucumber'; | ||
import puppeteer from "puppeteer"; | ||
|
||
const feature = loadFeature('./features/documentation.feature'); | ||
|
||
let page: puppeteer.Page; | ||
let browser: puppeteer.Browser; | ||
|
||
defineFeature(feature, test => { | ||
|
||
beforeAll(async () => { | ||
browser = process.env.GITHUB_ACTIONS | ||
? await puppeteer.launch() | ||
: await puppeteer.launch({ headless: true }); | ||
page = await browser.newPage(); | ||
|
||
await page | ||
.goto("https://dede-es5a.herokuapp.com/", { | ||
waitUntil: "networkidle0", | ||
}) | ||
.catch(() => { | ||
// This is intentional | ||
}); | ||
}); | ||
|
||
test('User consults project documentation', ({given,when,then}) => { | ||
jest.setTimeout(40000); | ||
|
||
given('A user who founds the site', () => { | ||
// This is intentional | ||
}); | ||
|
||
when('selects the documentation button on the footer', async () => { | ||
await Promise.all([ | ||
(await page.$x("/html/body/div[1]/div/div[2]/div[3]/div[2]/a")).at(0)?.click(), | ||
page.waitForNavigation(), | ||
]); | ||
}); | ||
|
||
then('is redirected to the documentation web page', async () => { | ||
await expect(page).toMatch('DeDe_es5a') | ||
}); | ||
}) | ||
|
||
afterAll(async ()=>{ | ||
browser.close() | ||
}) | ||
}); | ||
|
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,49 @@ | ||
import { defineFeature, loadFeature } from 'jest-cucumber'; | ||
import puppeteer from "puppeteer"; | ||
|
||
const feature = loadFeature('./features/source-code.feature'); | ||
|
||
let page: puppeteer.Page; | ||
let browser: puppeteer.Browser; | ||
|
||
defineFeature(feature, test => { | ||
|
||
beforeAll(async () => { | ||
browser = process.env.GITHUB_ACTIONS | ||
? await puppeteer.launch() | ||
: await puppeteer.launch({ headless: true }); | ||
page = await browser.newPage(); | ||
|
||
await page | ||
.goto("https://dede-es5a.herokuapp.com/", { | ||
waitUntil: "networkidle0", | ||
}) | ||
.catch(() => { | ||
// This is intentional | ||
}); | ||
}); | ||
|
||
test('User consults project source code', ({given,when,then}) => { | ||
jest.setTimeout(40000); | ||
|
||
given('A user who founds the site', () => { | ||
// This is intentional | ||
}); | ||
|
||
when('selects the source code button on the footer', async () => { | ||
await Promise.all([ | ||
(await page.$x("/html/body/div[1]/div/div[2]/div[3]/div[3]/a")).at(0)?.click(), | ||
page.waitForNavigation(), | ||
]); | ||
}); | ||
|
||
then('is redirected to GitHub', async () => { | ||
await expect(page).toMatch('master') | ||
}); | ||
}) | ||
|
||
afterAll(async ()=>{ | ||
browser.close() | ||
}) | ||
}); | ||
|