This file contains hidden or 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
'use strict'; | |
/*eslint no-console: ["error", { allow: ["log"] }] */ | |
// Dependencies | |
const express = require('express'); | |
const Raven = require('raven'); | |
const { port, allowedOrigins, sentryDSN } = require('./config'); | |
Raven.config(sentryDSN).install(); | |
const httpShutdown = require('http-shutdown'); | |
const bodyParser = require('body-parser'); |
This file contains hidden or 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 is used to serve the app for integration tests with the API via Cucumber | |
/*eslint no-console: ["error", { allow: ["log"] }] */ | |
// Dependencies | |
// | |
const express = require('express'); | |
const httpShutdown = require('http-shutdown'); | |
const path = require('path'); | |
const app = express(); | |
const config = require('./config'); |
This file contains hidden or 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
// Dependencies | |
const { After, Before, AfterAll } = require('cucumber'); | |
const scope = require('./support/scope'); | |
Before(async () => { | |
// You can clean up database models here | |
}); | |
After(async () => { | |
// Here we check if a scenario has instantiated a browser and a current page |
This file contains hidden or 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
// Dependencies | |
const { setWorldConstructor } = require('cucumber'); | |
const puppeteer = require('puppeteer'); | |
const scope = require('./support/scope'); | |
const World = function() { | |
scope.driver = puppeteer; | |
}; | |
setWorldConstructor(World); |
This file contains hidden or 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
const puppeteer = require('puppeteer'); | |
(async () => { | |
const browser = await puppeteer.launch(); | |
const page = await browser.newPage(); | |
await page.goto('https://google.co.uk'); | |
await page.screenshot({path: 'google.co.uk.png'}); | |
await browser.close(); | |
})(); |
This file contains hidden or 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
P-------- | |
Warnings: | |
1) Scenario: Successfully delete my data # features/delete_my_data.feature:6 | |
? Given I am a registered user # features/step_definitions/example_steps.js:3 | |
Pending | |
- When I login to the application # features/step_definitions/example_steps.js:8 | |
- And I visit my settings # features/step_definitions/example_steps.js:13 | |
- When I click on "Delete my data" # features/step_definitions/example_steps.js:18 |
This file contains hidden or 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
const { Given, When, Then } = require('cucumber'); | |
Given('I am a registered user', function () { | |
// Write code here that turns the phrase above into concrete actions | |
return 'pending'; | |
}); | |
When('I login to the application', function () { | |
// Write code here that turns the phrase above into concrete actions | |
return 'pending'; |
This file contains hidden or 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
UUUUUUUUU | |
Warnings: | |
1) Scenario: Successfully delete my data # features/delete_my_data.feature:6 | |
? Given I am a registered user | |
Undefined. Implement with the following snippet: | |
Given('I am a registered user', function () { | |
// Write code here that turns the phrase above into concrete actions | |
return 'pending'; |
This file contains hidden or 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
Feature: Delete my data | |
In order to no longer have any of my data stored on the application | |
As a registered user | |
I want to be able to delete my data from the application | |
Scenario: Successfully delete my data | |
Given I am a registered user | |
When I login to the application | |
And I visit my settings | |
When I click on "Delete my data" |
This file contains hidden or 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
Feature: Delete my data | |
In order to no longer have any of my data stored on the application | |
As a registered user | |
I want to be able to delete my data from the application |