Skip to content
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

Testing: Enable or remove skipped e2e tests #15538

Closed
4 of 16 tasks
gziolo opened this issue May 9, 2019 · 0 comments · Fixed by #18003
Closed
4 of 16 tasks

Testing: Enable or remove skipped e2e tests #15538

gziolo opened this issue May 9, 2019 · 0 comments · Fixed by #18003
Assignees
Labels
[Status] In Progress Tracking issues with work in progress [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. [Type] Tracking Issue Tactical breakdown of efforts across the codebase and/or tied to Overview issues.

Comments

@gziolo
Copy link
Member

gziolo commented May 9, 2019

We have recently disabled a few e2e tests to make Travis job pass consistently. Related PRs: #15059, #14986, #15211.

This issue is opened to coordinate efforts to either fix or remove all skipped e2e tests:

Reproducing issues

The biggest challenge we encountered in the past was the fact that all the aforementioned tests were failing randomly on Travis but it was nearly impossible to reproduce it locally. There is a plan to add some debugging capabilities to npm run test-e2e command but for the time being, I recommend using the following patch to slow down CPU and network to simulate conditions similar to Travis. You still might need to run the same test a few times to be able to see failure.

diff --git a/packages/e2e-tests/config/setup-test-framework.js b/packages/e2e-tests/config/setup-test-framework.js
index b14717620..f8e70c62e 100644
--- a/packages/e2e-tests/config/setup-test-framework.js
+++ b/packages/e2e-tests/config/setup-test-framework.js
@@ -198,6 +198,20 @@ async function runAxeTestsForBlockEditor() {
 // other posts/comments/etc. aren't dirtying tests and tests don't depend on
 // each other's side-effects.
 beforeAll( async () => {
+	const client = await page.target().createCDPSession();
+	await client.send( 'Network.emulateNetworkConditions', {
+		// Whether chrome should simulate
+		// the absence of connectivity
+		offline: false,
+		// Simulated download speed (bytes/s)
+		downloadThroughput: 1.5 * 1024 * 1024 / 8,
+		// Simulated upload speed (bytes/s)
+		uploadThroughput: 750 * 1024 / 8,
+		// Simulated latency (ms)
+		latency: 40,
+	} );
+	await client.send( 'Emulation.setCPUThrottlingRate', { rate: 8 } );
+
 	capturePageEventsForTearDown();
 	enablePageDialogAccept();
 	observeConsoleLogging();

It is super useful to run e2e tests in watch mode and with the real browser:

npm run test-e2e:watch -- --puppeteer-interactive --puppeteer-slowmo=0
@gziolo gziolo added [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. [Type] Tracking Issue Tactical breakdown of efforts across the codebase and/or tied to Overview issues. labels May 9, 2019
@gziolo gziolo added the Good First Issue An issue that's suitable for someone looking to contribute for the first time label May 9, 2019
@gziolo gziolo added the Needs Dev Ready for, and needs developer efforts label Aug 12, 2019
@gziolo gziolo self-assigned this Oct 17, 2019
@gziolo gziolo added [Status] In Progress Tracking issues with work in progress and removed Good First Issue An issue that's suitable for someone looking to contribute for the first time Needs Dev Ready for, and needs developer efforts labels Oct 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] In Progress Tracking issues with work in progress [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. [Type] Tracking Issue Tactical breakdown of efforts across the codebase and/or tied to Overview issues.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant