Skip to content

Instantly share code, notes, and snippets.

@axelneff
Created March 19, 2019 20:37
Show Gist options
  • Select an option

  • Save axelneff/27a0fc6c06a9f679e1633a7ea52ebf18 to your computer and use it in GitHub Desktop.

Select an option

Save axelneff/27a0fc6c06a9f679e1633a7ea52ebf18 to your computer and use it in GitHub Desktop.
Test Script for Nice-Foods Marketplace
const Nightmare = require('nightmare')
const assert = require('assert')
describe('Landing Page', function() {
this.timeout('30s')
let nightmare = null
beforeEach(() => {
nightmare = new Nightmare({ show: true })
})
describe('/ (Home Page)', () => {
it('should render landing page', done => {
nightmare.goto('http://localhost:3000/')
.exists('#root > div > div > div > div > div > div:nth-child(1) > a > img')
.exists('#root > div > div > div > div > div > div:nth-child(1) > a > span > b')
.exists('#root > div > div > div > div > div > div:nth-child(1) > a > small')
.click('#root > div > div > div > div > div > div:nth-child(1) > a > img')
.end()
.then(function (result) { done() })
.catch(done)
})
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment