-
Notifications
You must be signed in to change notification settings - Fork 676
Add service worker to make multiple requests for the test page (closes #5239) #5738
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
Conversation
❌ Tests for the commit 2b54709 have failed. See details: |
1 similar comment
❌ Tests for the commit 2b54709 have failed. See details: |
❌ Tests for the commit e2abdb7 have failed. See details: |
7b44669
to
2613571
Compare
❌ Tests for the commit 2613571 have failed. See details: |
2379298
to
c85207d
Compare
❌ Tests for the commit c85207d have failed. See details: |
267f817
to
3fdc3d3
Compare
❌ Tests for the commit 3fdc3d3 have failed. See details: |
❌ Tests for the commit 8dc3a40 have failed. See details: |
❌ Tests for the commit 98a5c92 have failed. See details: |
❌ Tests for the commit 98a5c92 have failed. See details: |
❌ Tests for the commit 98a5c92 have failed. See details: |
❌ Tests for the commit 98a5c92 have failed. See details: |
❌ Tests for the commit 98a5c92 have failed. See details: |
❌ Tests for the commit 98a5c92 have failed. See details: |
1 similar comment
❌ Tests for the commit 98a5c92 have failed. See details: |
✅ Tests for the commit 6e1a499 have passed. See details: |
while (command.cmd === COMMAND.idle) { | ||
await browser.delay(CHECK_STATUS_DELAY); | ||
|
||
({ command } = await browser.checkStatus(this.statusUrl, createXHR)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
await browser.checkStatus(this.statusUrl, createXHR);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you suggest to remove additional brackets? They are required if we need to destruct objects into already declared variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, it's my mistake. All is OK.
this.statusIndicator.showDisconnection(); | ||
|
||
throw error; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which subsystem will handle this error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... As I see in the previous version this error was caught and not rethrown. As far as I understand now we rethrow explicitly. @AndreyBelym could you add more details on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is not so much point about it. While debugging, I thought that it would be useful to see an error in the browser console when the browser finally gives up and disconnects. Except for an error in the console, the result is the same as in the previous version - when the browser disconnects, we lost him until someone somehow connects it back manually vi reloading or whatever.
src/client/browser/index.js
Outdated
const STATUS_RETRY_DELAY = 1000; | ||
const MAX_STATUS_RETRY = 5; | ||
|
||
const SERVICE_WORKER_LOCATION = LOCATION_ORIGIN + `/service-worker.js`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move services routes to constant and use it here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get it (
It's already in const, Do you want to extract /service-worker.js
to the separate const?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
async function tryGetResponse (request) { | ||
try { | ||
return { response: await fetch(request) }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check that fetch
is not overridden.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fetch
cannot be overridden here, since we are on the idle page
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
@@ -0,0 +1,47 @@ | |||
const MAX_RETRY = 10; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Write the new files with TypeScript.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this moment, only server-side scripts are written in TS. It is not an easy task to enable TS for client scripts in the context of the current issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Let's make it a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this moment, only server-side scripts are written in TS.
this my statement is wrong. However, it is still not easy in the context of this PR. So, yes, I would prefer to make separate PR for this
test/functional/config.js
Outdated
@@ -64,7 +64,10 @@ testingEnvironments[testingEnvironmentNames.mobileBrowsers] = { | |||
accessKey: process.env.BROWSER_STACK_ACCESS_KEY | |||
}, | |||
|
|||
retryTestPages: true, | |||
ssl: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you will implement some other changes, could you please remove the ssl
and retryTestPages
from mobile browsers and macOS + Edge config?
SSL is quite useless without enabling retryTestPages
, but we can't enable it right now due to workers are not supported by the current Safari and iOS test devices and we need to debug some complex tests to use newer browsers versions.
Thank you for a great job and finishing this painful PR |
✅ Tests for the commit e2e078c have passed. See details: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a customer runs the feature in the default way (HTTP, IP as hostname)
testcafe chrome tests --retryTestPages
then it will know that the feature is not working.
Need to inform the customer what the feature is not turning on
The 'retryTestPages' is not turning on.
You need to run TestCafe on the 'secure' host.
To do that:
-- specify the 'localhost' values for the 'hostname' option
-- run TestCafe over HTTPS protocol
and the browser (IE 11) doesn't allow to use of this feature
We are sorry, but you cannot use the `retryTestPages` feature
because the browser doesn't support the 'ServiceWorker' feature.
To start your tests remove this option.
To simplify the review process, it's better to merge this PR now. |
No description provided.