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
// 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 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 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 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 api = require('api'); | |
const web = require('web'); | |
const { setWorldConstructor } = require('cucumber'); | |
const puppeteer = require('puppeteer'); | |
const scope = require('./support/scope'); | |
const World = function() { | |
scope.host = web.host; | |
scope.driver = puppeteer; |
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
/*eslint no-console: ["error", { allow: ["log"] }] */ | |
// Dependencies | |
const { After, Before, AfterAll } = require('cucumber'); | |
const scope = require('./support/scope'); | |
Before(async () => { | |
}); | |
After(async () => { | |
if (scope.browser && scope.context.currentPage) { |
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
/*eslint no-console: ["error", { allow: ["log"] }] */ | |
// Dependencies | |
const { After, Before, AfterAll } = require('cucumber'); | |
const {mongoose, redis } = require('api/db'); | |
const { | |
User, | |
Dashboard, | |
DashboardUser, | |
Session, | |
ForgotPassword, |
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
// Dependencies | |
const { Given, When, Then } = require('cucumber'); | |
const { | |
visitHomepage, | |
assertUserHasPassword, | |
assertUserHasEmail, | |
userExists, | |
closeAccount, | |
pending, | |
clickOnItem, |
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
// Dependencies | |
const assert = require('assert'); | |
const { | |
Dashboard, | |
DashboardUser, | |
User, | |
Organisation, | |
OrganisationUser, | |
ForgotPassword | |
} = require('api/models'); |
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
Given('I login', { timeout: 10000 }, async () => { | |
await visitHomepage(); | |
await clickOnItem('Login'); | |
await takenToPage('login'); | |
await fillInFormField('identifier', email); | |
await fillInFormField('password', password); | |
await pressButton('Login'); | |
return await shouldBeOnPage('dashboard'); | |
}); |
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
const { Dashboard, Organisation } = require('api/models'); | |
const pages = { | |
home: '/', | |
login: '/login', | |
signup: '/signup', | |
'forgot-password': '/forgot-password', | |
dashboard: '/dashboard', | |
account: '/account', | |
organisations: '/account/organisations', |