You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.
Introduce an API to the NPM module to make it easy to run scripts as part of suite of tests. This would let us integrate with unit test frameworks such as mocha. For example:
const{describe, before, it}=require('mocha-sugar-free');const{runner}=require('openrunner');describe('My Website\'s fancy click path',()=>{letresult;before({timeout: 60000},async()=>{result=awaitrunner(async()=>{'Openrunner-Script: v1';consttabs=awaitinclude('tabs');awaitinclude('wait');consttab=awaittabs.create();awaittab.navigate('http://computest.nl/',{timeout: '10s'});awaittransaction('HomePage',asynct=>{awaittab.wait(async()=>{awaitwait.timeout('10s').documentComplete().selector('#layerslider_1 p.slider-text').containsText('Hoe snel zijn je systemen').isDisplayed();});});});});it('Should run without error',()=>{result.assertNoError();});it('Should open the homepage within 4 seconds',()=>{result.transaction('HomePage').assertDuration('4s');});});
The runner() function in this example should take care of creating the profile and starting the brower the first time, and then keep it active for further tests. Before node.js exits we should close firefox and cleanup the profile. We should also provide explicit functions to do this initialisation & cleanup.
The text was updated successfully, but these errors were encountered:
Introduce an API to the NPM module to make it easy to run scripts as part of suite of tests. This would let us integrate with unit test frameworks such as mocha. For example:
And then:
The
runner()
function in this example should take care of creating the profile and starting the brower the first time, and then keep it active for further tests. Before node.js exits we should close firefox and cleanup the profile. We should also provide explicit functions to do this initialisation & cleanup.The text was updated successfully, but these errors were encountered: