codemod
codemod copied to clipboard
Error with sendKeys(Key.UP)
Sending 1 files to free worker...
ERR test\e2e\pages\series-actions.ts Transformation error (Error transforming test\e2e\pages\series-actions.ts:276)
Error transforming test\e2e\pages\series-actions.ts:276
> await protractor.browser.actions().sendKeys(Key.UP).perform()
^
Expected "proctractor.Key.XXX" as argument to the sendKeys command. Please raise an issue in the codemod repository: https://github.com/webdriverio/codemod/issues/new
at test\e2e\pages\series-actions.ts:276:22
The interesting bit seems to be
it('should select the series and combine', async () =>{
// select the series
let thumbnails:ElementFinder[] = await thumbs.thumbnails();
expect(thumbnails).not.toBeUndefined();
//reset selection to first series
for(let i = 0 ; i < seriesCount ; i++){
await protractor.browser.actions().sendKeys(Key.UP).perform();
}
// scroll down to series via arrow keys
for( let s = 0 ; s < selectedSeries ; s++ ){
await protractor.browser.actions().sendKeys(Key.DOWN).perform();
}
expect(thumbnails[selectedSeries].isSelected()).toBeTruthy();
})
Any contributions that help transform that bit to browser.keys(...) would be much appreciated.
Sending 1 files to free worker... ERR test\e2e\pages\series-actions.ts Transformation error (Error transforming test\e2e\pages\series-actions.ts:276) Error transforming test\e2e\pages\series-actions.ts:276 > await protractor.browser.actions().sendKeys(Key.UP).perform() ^ Expected "proctractor.Key.XXX" as argument to the sendKeys command. Please raise an issue in the codemod repository: https://github.com/webdriverio/codemod/issues/new at test\e2e\pages\series-actions.ts:276:22The interesting bit seems to be
it('should select the series and combine', async () =>{ // select the series let thumbnails:ElementFinder[] = await thumbs.thumbnails(); expect(thumbnails).not.toBeUndefined(); //reset selection to first series for(let i = 0 ; i < seriesCount ; i++){ await protractor.browser.actions().sendKeys(Key.UP).perform(); } // scroll down to series via arrow keys for( let s = 0 ; s < selectedSeries ; s++ ){ await protractor.browser.actions().sendKeys(Key.DOWN).perform(); } expect(thumbnails[selectedSeries].isSelected()).toBeTruthy(); })
Hope this work around helps ( https://github.com/webdriverio/codemod/issues/45#issuecomment-1404109549 )