generated from Arquisoft/wiq_0
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trying to solve some conflicts and also added tests for instructions
- Loading branch information
Showing
4 changed files
with
64 additions
and
15 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,9 @@ | ||
Feature: Instructions page functionality | ||
|
||
Scenario: Instructions view is well rendered | ||
Given I am on the instructions page | ||
Then The instructions title is rendered | ||
Then The instructions content is rendered | ||
|
||
|
||
|
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,40 @@ | ||
const puppeteer = require('puppeteer'); | ||
const { defineFeature, loadFeature } = require('jest-cucumber'); | ||
const setDefaultOptions = require('expect-puppeteer').setDefaultOptions; | ||
|
||
const feature = loadFeature('./features/instructions.feature'); | ||
|
||
let page; | ||
let browser; | ||
|
||
defineFeature(feature, test => { | ||
|
||
beforeAll(async () => { | ||
browser = await puppeteer.launch({ | ||
slowMo: 20, | ||
defaultViewport: { width: 1920, height: 1080 }, | ||
args: ['--window-size=1920,1080'] | ||
}); | ||
page = await browser.newPage(); | ||
setDefaultOptions({ timeout: 10000 }); | ||
}); | ||
|
||
test('Instructions view is well rendered', ({ given, then }) => { | ||
given('I am on the instructions page', async () => { | ||
await page.goto('http://localhost:3000/instructions'); | ||
await page.waitForSelector('.instructions_title'); | ||
}); | ||
|
||
then('The instructions title is rendered', async () => { | ||
await expect(page).toMatchElement('.instructions_title'); | ||
}); | ||
|
||
then('The instructions content is rendered', async () => { | ||
await expect(page).toMatchElement('.ins_ul'); | ||
}); | ||
}); | ||
|
||
afterAll(async () => { | ||
await 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