Created
March 19, 2019 20:37
-
-
Save axelneff/27a0fc6c06a9f679e1633a7ea52ebf18 to your computer and use it in GitHub Desktop.
Test Script for Nice-Foods Marketplace
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 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