Open jennyliang220 opened 3 years ago
E2E candidates: https://github.com/puppeteer/puppeteer 66.5k stars https://github.com/segmentio/nightmare 18.7k stars
Example using nightmare
const Nightmare = require('nightmare')
const chai = require('chai')
const expect = chai.expect
describe('test duckduckgo search results', () => {
it('should find the nightmare github link first', function(done) {
this.timeout('10s')
const nightmare = Nightmare()
nightmare
.goto('https://duckduckgo.com')
.type('#search_form_input_homepage', 'github nightmare')
.click('#search_button_homepage')
.wait('#links .result__a')
.evaluate(() => document.querySelector('#links .result__a').href)
.end()
.then(link => {
expect(link).to.equal('https://github.com/segmentio/nightmare')
done()
})
})
})
The main problem is not to interpret the page but running specberus in the test suite and make sure it responds as expected.
Estimated time: 3hrs