DevExpress / testcafe

A Node.js tool to automate end-to-end web testing.
https://testcafe.io
MIT License
9.82k stars 673 forks source link

Testcafe unable to load site properly #7312

Closed PrashantSingh5946 closed 1 year ago

PrashantSingh5946 commented 2 years ago

What is your Scenario?

We are testing an ecommerce site hosted at https://ring1tie.adventure-works.com, this site earlier worked fine with testcafe but since last couple of months testcafe is unable to load the page properly and many elements including the increase/ decrease button do not work and there is an error in console logs console

https://user-images.githubusercontent.com/70136137/192834423-dd4d754f-6eb6-4aaf-9e52-c65b7320a2f1.mp4

What is the Current behavior?

Increment/decrement and cart buttons are not working when opened on the testcafe server, they are otherwise working fine on normal browsers.

What is the Expected behavior?

The buttons should work fine

What is your public website URL? (or attach your complete example)

https://user-images.githubusercontent.com/70136137/192836325-76d80687-ad51-4792-b414-4dff57a46332.mp4

URL: https://ring1tie.adventure-works.com/awbusiness/tegothar-women-s-coat/68719519893.p

What is your TestCafe test code?

import { Selector } from "testcafe";

fixtureCheckout Page Tests .page( "https://ring1tie.adventure-works.com/awbusiness/tegothar-women-s-coat/68719519893.p" ) .beforeEach(async (testController) => { await testController.maximizeWindow(); });

test("Validate checkout page", async (testController: TestController) => { await testController.wait(2000); if (await Selector('[aria-label="Accept cookies"]').exists) { await testController.click('[aria-label="Accept cookies"]'); } await testController .hover("#ms-buyboxproduct-quantity-input button.increment") .wait(1000) .click("#ms-buyboxproduct-quantity-input button.increment"); let currentCount = await Selector('[aria-label="quantity input"]').value; await testController .expect(currentCount) .eql("2", "Click element is not working")

.hover("#ms-buybox__product-quantity-input button.decrement")
.wait(1000)
.click("#ms-buybox__product-quantity-input button.decrement");

await testController.wait(5000); currentCount = await Selector('[aria-label="quantity input"]').value; await testController.expect(currentCount).eql("1"); });

Your complete configuration file

No response

Your complete test report

No response

Screenshots

console

Steps to Reproduce

  1. Go to the following URL on testcafe https://ring1tie.adventure-works.com/awbusiness/tegothar-women-s-coat/68719519893.p
  2. Notice how the increment and decrement buttons are not working

TestCafe version

2.0.0

Node.js version

v16.13.0

Command-line arguments

yarn testcafe test.js --skip-js-errors

Browser name(s) and version(s)

Chrome latest

Platform(s) and version(s)

Windows

Other

No response

AlexKamaev commented 2 years ago

I managed to reproduce the issue. It occurs in the latest versions of Chrome/Firefox. Moreover, I was able to reproduce the issue in v1.19.0. Could please specify the latest working TestCafe version for your usage scenario? It will help us determine the cause of the issue.

PrashantSingh5946 commented 2 years ago

I have tried various testcafe versions till 1.10.0 and the bug reproduces on all of those versions. Everything seemed working fine until 30-06-2022, after this date almost all the tests started failing.

AlexKamaev commented 2 years ago

I managed to reproduce the issue with previous Chrome versions as well. The cause of the issue is still unclear, so we need time to research it.

miherlosev commented 1 year ago

Hi @PrashantSingh5946 ,

TestCafe runs tests using the URL-rewritten proxy. This approach is good. However, there is a way to improve the stability and speed of test execution - the native browser automation API. We have a test execution mode uses native browser automation - we call it the Proxyless mode. In Proxyless mode, a few issues are already fixed. By the way, this issue was also fixed in Proxyless mode. Try running your tests in Proxyless mode and let us know the results. This option is available in all interfaces:

// Command-line
testcafe chrome tests --experimental-proxyless

// Programmatic
const testcafe = await createTestCafe({ experimentalProxyless: true });

// Configuration file
{
   "experimentalProxyless": "true"
}   

Note that at present it is an experimental mode. Also, the Proxyless mode is implemented only in Google Chrome. It will not work correctly if you run tests in a non-Chrome browser or in a combination of other browsers.

miherlosev commented 1 year ago

Hi @PrashantSingh5946,

This issue is not reproduced with combination of testcafe@3.0.1 and the Google Chrome browser. Feel free to reopen this issue if you encounter it in other browsers.