vendredi 26 juin 2020

Unable to access Instagram while running scripts via Jenkins

This code works fine when I run it in VS Code. But when triggered through Jenkins, on clicking the Instagram icon, I get the splash page (screenshot) and it doesn't load the actual page. I tried putting additional waits, tried in different browsers - no luck. Any help would be greatly appreciated. At this point, I am not really sure if it is a testcafe issue.

import { Selector, ClientFunction } from 'testcafe'

const browserscroll = ClientFunction(function () {
    window.scrollBy(0, 200)
});

fixture`Feedback Test`
    .page`https://www.macys.com/`

    .before(async t => {
    })

    .beforeEach(async t => {
        await t.setTestSpeed(0.3)
        await t.maximizeWindow()
    })

test("Feedback", async t => {
    const instaLink = Selector('a').withText('Instagram')
    await t.maximizeWindow()
    while (!(await instaLink.exists)) {
        await browserscroll()
    }
    await t.click(instaLink)
    await t.wait(15000)
})

Screenshot: screenshot

Aucun commentaire:

Enregistrer un commentaire