w3c / specberus

Checker used at W3C to validate the compliance of Technical Reports with publication rules
https://www.w3.org/pubrules/
MIT License
77 stars 46 forks source link

Add test for pubrules, to make sure UI runs well #1028

Open jennyliang220 opened 3 years ago

jennyliang220 commented 3 years ago

Estimated time: 3hrs

jennyliang220 commented 3 years ago

E2E candidates: https://github.com/puppeteer/puppeteer 66.5k stars https://github.com/segmentio/nightmare 18.7k stars

jennyliang220 commented 3 years ago

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()
      })
  })
})
deniak commented 3 years ago

The main problem is not to interpret the page but running specberus in the test suite and make sure it responds as expected.