testproject-io / javascript-opensdk

TestProject OpenSDK for Node.js
Apache License 2.0
24 stars 16 forks source link

Failed using driver.manage().window().setSize() #26

Open ShaharGilad opened 3 years ago

ShaharGilad commented 3 years ago

running the following code with selenium webdriver works fine, with @tpio/javascript-opensdk I got an error.

describe('search youtube chrome', () => {
    let driver;

    before(async () => {
        driver = await new Builder().forBrowser('chrome').withToken(CONSTANT.TOKEN).build();
    });

    after(async () => {
        await driver.quit(); 
    });

    it('Resize window', async () => {
        await driver.get(CONSTANT.BASE_URL);
        await driver.findElement(By.id('guide-icon')).click();
        await driver.findElement(By.linkText('Gaming')).click();

        let videosElements;
        await driver.wait(async () => {
            videosElements = await driver.findElements(By.xpath("//a[contains(@class, 'yt-simple-endpoint style-scope ytd-grid-video-renderer')]"));
            return videosElements.length !== 0;
        }, 3000);

        assert.equal(videosElements.length, videosElements.length);
        await driver.manage().window().setSize(411, 371);
    });
});

Error displayed: image