New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
execution stucks! #8180
Comments
@PavelMor25 please have a look, it's critical |
Hello @vasilyevi,
Unfortunately, For this reason, we added a fixture`A set of examples that illustrate how to use TestCafe API`
.afterEach(async t => {
await t.takeScreenshot();
})
.beforeEach(async t => {
const cdpClient = await t.getCurrentCDPSession();
await cdpClient.Network.setBypassServiceWorker({bypass: true});
}) Let us know if this helps. |
It helps, could you also take a look at point 2? |
Hello @vasilyevi, Try to make the selector more specific to improve the search for the element on the page. Also, you can add a reduced timeout to the selector. These recommendations should speed up your test: // specific selector
await t.click(Selector('#content .x-1spwbp4.et1glnj1').nth(1))
// timeout
await t.click(Selector("a[class][href*='best-vacation-packages'] div>img", {timeout: 7000})); |
What is your Scenario?
n/a
What is the Current behavior?
await t.click(Selector("div > a[class][href*='best-vacation-packages'] div>img"));
div > a[class][href*='best-vacation-packages'] div>img
for too long, but is able to find itWhat is the Expected behavior?
works fine with 3.4.0
What is the public URL of the test page? (attach your complete example)
n/a
What is your TestCafe test code?
import { RequestHook, Selector, t } from 'testcafe';
fixture
A set of examples that illustrate how to use TestCafe API
.afterEach(async t => {
await t.takeScreenshot();
})
async function waitForEnabled(selector, timeout = 20000) {
await t
.expect(selector.hasAttribute("disabled"))
.notOk(
element '${selector[Object.getOwnPropertySymbols(selector)[0]].fn}' is not enabled
, {timeout,
});
}
test('test', async t => {
await t.maximizeWindow();
await t.navigateTo("https://guidetoeurope.com/best-vacation-packages?dateFrom=2024-05-19&dateTo=2024-05-27&destinationId=6effc2e7-a07e-469b-ba50-d66c308557a7&destinationName=Podgorica%2C%20Montenegro&includeFlights=1&numberOfDays=9&numberOfStops=any&occupancies=1&originId=616de33c-c8cb-4670-9580-0e1aa56afb48&originName=London%2C%20England&originType=2&requestId=df6a0e28-aa31-4566-2035-224ec87165e0");
await t.click(Selector("div > a[class][href*='best-vacation-packages'] div>img"));
const asd = await Selector("h1[class]").textContent;
console.log(asd);
await waitForEnabled(Selector("[id='vp-booking-widget-form'] button"));
await t.click(Selector("[id='vp-booking-widget-form'] button"));
await t.click(Selector("input[id='cardNumber']"))
});
Your complete configuration file
module.exports = {
screenshots: {
path: "./artifacts/screenshots",
takeOnFails: true,
pathPattern: "${DATE}${TIME}/${TEST}/${FILE_INDEX}${QUARANTINE_ATTEMPT}.png",
thumbnails: false
},
disableMultipleWindows: true,
browsers: "chrome",
concurrency: 3,
skipJsErrors: true,
browserInitTimeout: 120000,
pageLoadTimeout: 60000,
pageRequestTimeout: 65000,
selectorTimeout: 20000,
testExecutionTimeout: 720000,
quarantineMode: false,
disableNativeAutomation: false
}
Your complete test report
No response
Screenshots
No response
Steps to Reproduce
just run the code
TestCafe version
3.6.0
Node.js version
v18.19.1
Command-line arguments
yarn testcafe
Browser name(s) and version(s)
No response
Platform(s) and version(s)
No response
Other
No response
The text was updated successfully, but these errors were encountered: