Closed picimako closed 3 years ago
Since Terra.it helpers are deprecated since terra-toolkit 6.11.0 (see terra-toolkit changelog), and inspection with quick fixes would be useful to help users migrate their tests to Terra.validates calls.
Terra.it
Terra.validates
See also Terra Commands.
Without hooks:
Terra.it.validatesElement(); would become it('INSERT TEST NAME', () => { Terra.validates.element(); }); ---------------------------- Terra.it.validatesElement('test name'); would become it('INSERT TEST NAME', () => { Terra.validates.element('test name'); }); ---------------------------- Terra.it.validatesElement('test name' { selector: '#selector' }); would become it('INSERT TEST NAME', () => { Terra.validates.element('test name', { selector: '#selector' }); });
With the before hook:
before
describe('describe block', () => { before(() => { browser.url('/'); }); Terra.it.validatesElement('test name', { selector: '#selector' }); }); would become describe('describe block', () => { it('INSERT TEST NAME', () => { browser.url('/'); Terra.validates.element('test name', { selector: '#selector' }); }); });
before hook with multiple Terra.it calls after:
describe('describe block', () => { before(() => { browser.url('/'); }); Terra.it.validatesElement('test', { selector: '#selector' }); Terra.it.matchesScreenshot('test', { selector: '#anotherselector' }); }); would become describe('describe block', () => { it('INSERT TEST NAME', () => { browser.url('/'); Terra.validates.element('test', { selector: '#selector' }); Terra.validates.screenshot('name', { selector: '#anotherselector' }); }); });
These also apply to the misMatchTolerance and axeRules properties, as well as the Terra.it.matchesScreenshot() and Terra.it.isAccessible() helpers.
Execute the inspection only when terra-toolkit is included in the project's package.json file with version 6.11.0 at least.
Classes that might be useful:
Completed on release branch.
Summary of scope
Since
Terra.it
helpers are deprecated since terra-toolkit 6.11.0 (see terra-toolkit changelog), and inspection with quick fixes would be useful to help users migrate their tests toTerra.validates
calls.See also Terra Commands.
Solution details
Terra.it
helper usage.Without hooks:
With the
before
hook:before hook with multiple Terra.it calls after:
These also apply to the misMatchTolerance and axeRules properties, as well as the Terra.it.matchesScreenshot() and Terra.it.isAccessible() helpers.
Nice to have
Execute the inspection only when terra-toolkit is included in the project's package.json file with version 6.11.0 at least.
Classes that might be useful:
Out of scope