faltest icon indicating copy to clipboard operation
faltest copied to clipboard

How do I use chai assertions

Open NullVoxPopuli opened this issue 5 years ago • 1 comments

I see that there is a chai package, and that it exports chaiWebDriver, what's that do and where do I put it?

NullVoxPopuli avatar Apr 28 '20 11:04 NullVoxPopuli

The answer:

create a new file containing:

const chai = require('chai');
const chaiWebDriver = require('@faltest/chai');

chai.use(chaiWebDriver); // provides page object apis
chai.use(require('chai-string'));
chai.use(require('chai-fs'));
chai.use(require('chai-as-promised')); // provides "eventually"

module.exports = chai;

then require that file:

const { expect } = require('path/to/that/file');

NullVoxPopuli avatar Apr 28 '20 11:04 NullVoxPopuli