Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Apr 09 03:26
    dependabot[bot] labeled #7
  • Apr 09 03:26
    dependabot[bot] opened #7
  • Apr 09 03:26

    dependabot[bot] on npm_and_yarn

    Bump minimist from 1.2.5 to 1.2… (compare)

  • Mar 31 15:14
    dependabot[bot] labeled #204
  • Mar 31 15:14
    dependabot[bot] opened #204
  • Mar 31 15:14

    dependabot[bot] on npm_and_yarn

    Bump shelljs from 0.8.4 to 0.8.… (compare)

  • Mar 31 15:14
    dependabot[bot] labeled #203
  • Mar 31 15:14
    dependabot[bot] opened #203
  • Mar 31 15:14

    dependabot[bot] on npm_and_yarn

    Bump minimist from 1.2.5 to 1.2… (compare)

  • Mar 31 15:14

    jason0x43 on master

    Update dev dependency and api-d… (compare)

  • Mar 29 19:28

    dependabot[bot] on npm_and_yarn

    (compare)

  • Mar 29 19:28

    dependabot[bot] on npm_and_yarn

    (compare)

  • Mar 29 19:28

    jason0x43 on master

    Bump minimist from 1.2.5 to 1.2… (compare)

  • Mar 29 19:28
    jason0x43 closed #98
  • Mar 29 19:28
    jason0x43 closed #97
  • Mar 29 19:28

    jason0x43 on master

    Bump follow-redirects from 1.14… (compare)

  • Mar 29 19:19

    jason0x43 on master

    Update cbt_tunnels and SauceCon… (compare)

  • Mar 29 13:52
    dependabot[bot] labeled #98
  • Mar 29 13:52
    dependabot[bot] opened #98
  • Mar 29 13:52

    dependabot[bot] on npm_and_yarn

    Bump minimist from 1.2.5 to 1.2… (compare)

Jason Cheatham
@jason0x43
You can dynamically set the tunnel hostname, so you should be able to write an Intern plugin that would determine the hostname (however it does that) and then updates the config before the test run starts. Or you could write a wrapper script that determines the hostname, generates a config with that information, and then starts intern.
Tyoneb
@Tyoneb

Hello, I can't seem to find a Leadfoot API that matches the "new window" WebDriver endpoint (https://www.w3.org/TR/webdriver/#new-window). Am I missing something? Or is it because MDN indicates that it's only supported by IE and Firefox?

In which case, would you recommend to use the following?

remote.pressKeys([keys.CONTROL, 't', keys.NULL])

or something like?

remote.execute('window.open()')
Jason Cheatham
@jason0x43
Leadfoot doesn't implement the window/new endpoint. However, if you open a new window with one of the methods you suggest, you can get use getAllWindowHandles() to get a list of available handles, and then switchToWindow to switch to a new one.
rhpijnacker
@rhpijnacker

Last year, we ran into reporter issues with circular referenced structures. Back then we opened up #1167 for this.
The same problem sneaked up once more, leading to non-failing builds where actually a failure should have been reported:

chrome on windows: 6343 passed, 0 failed
msedge on windows: 6343 passed, 0 failed
Safari on macOS: 6343 passed, 0 failed
TOTAL: tested 3 platforms, 0 passed, 0 failed, 19029 not run

A zero exit code was causing this problem to go undetected for weeks.
In the browsers we are seeing:

Error sending testEnd: Converting circular structure to JSON
  --> starting at object with constructor 'Object'
  |   property 'a' -> object with constructor 'Object'
  --- property 'b' closes the circle
rhpijnacker
@rhpijnacker
It looks like somehow Intern is aware of a problem (seeing how it reports "X not run"), but it still exit with a success exit code
I've been looking at remote.ts for a good place to "fix this" (i.e. catch a failing JSON.stringify call and handle that in some way), but I'm having some trouble finding a good solution
rhpijnacker
@rhpijnacker

So far, adding

    if (data && data.error) {
      try {
        JSON.stringify(data.error);
      } catch (e) {
        data.error.actual = data.error.expected = undefined;
      }
    }

to remote.ts before calling sendMessage seems to be working around the problem, but it exposes details about data that we probably do not want to know about at this level.

@jason0x43 do you have a suggestion for a nicer way to handle this?
Jason Cheatham
@jason0x43
Hmmm...assuming the issue is what PatrickSach's comment suggests, the best solution would probably be to use a custom replacer with JSON.stringify at the point where the message is being stringified and filter out circular references.
rhpijnacker
@rhpijnacker
I think I found a reasonably clean solution using the custom replacer, as you suggested.
As far as I can see, the similar code in BaseChannel.sendMessage could now be removed. Do you agree?
I considered moving the replacer to the base class, but did not really like how that turned out. What do you think would be better?
Jason Cheatham
@jason0x43
What if you updated the stringify function in lib/common/util.ts to handle Errors, and potentially general circular references, as this MDN snippet does? Then use that stringify in the channels.
rhpijnacker
@rhpijnacker
Good idea! Updated the #1185 accordingly.
Marco Pernigo
@Gjed

Hello,
I'm trying to get the code coverage working with functional test but I keep getting errors with heap memory alloc:

<--- Last few GCs --->

[89697:0x5723730]    82022 ms: Scavenge (reduce) 4080.1 (4103.0) -> 4079.6 (4103.3) MB, 4.5 / 0.0 ms  (average mu = 0.193, current mu = 0.078) allocation failure 
[89697:0x5723730]    82028 ms: Scavenge (reduce) 4080.4 (4100.3) -> 4079.8 (4101.3) MB, 4.9 / 0.0 ms  (average mu = 0.193, current mu = 0.078) allocation failure 
[89697:0x5723730]    82034 ms: Scavenge (reduce) 4081.1 (4100.8) -> 4080.6 (4102.0) MB, 4.6 / 0.0 ms  (average mu = 0.193, current mu = 0.078) allocation failure 


<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0xa389b0 node::Abort() [node]
 2: 0x96e0af node::FatalError(char const*, char const*) [node]
 3: 0xbb7a4e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
 4: 0xbb7dc7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
 5: 0xd73fd5  [node]
 6: 0xd74b5f  [node]
 7: 0xd8299b v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
 8: 0xd8655c v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
 9: 0xd54c3b v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node]
10: 0x109d21f v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [node]
11: 0x1446379  [node]
Aborted

I know that someone alreay asked but i didn't see any aswer..
Any ideas?

rhpijnacker
@rhpijnacker
@jason0x43 , did you see my update to #1185?
Jason Cheatham
@jason0x43
I saw that you updated it, but I hadn't had a chance to look yet. :eyes:
Jason Cheatham
@jason0x43
Could you re-target it against master? (The monorepo conversion was put on hold, and dev switched back to master.)
rhpijnacker
@rhpijnacker
Not sure how re-targetting is supposed to work. Is this something I can change to the existing PR, or should I just create a new PR?
Jason Cheatham
@jason0x43
Edit your PR (edit button to the right of the title), then change what you want to merge your commits into from the 4.x branch to master (there should be a selector under the title).
And you should actually rebase your PR on master. Hmmm...it may just be easier to open a new one. :grinning:
rhpijnacker
@rhpijnacker
ok, I think I'll do that then
rhpijnacker
@rhpijnacker
... then again, maybe not :(
Looks like I've messed up my fork somehow to the point where I'm unsure how to fix this.
rhpijnacker
@rhpijnacker
I think I manged to create a new clean branch on upstream/master, but now it will not let me commit.
The pre-commit hook is trying to run husky-run, but it says "Error: could not determine executable to run".
Jason Cheatham
@jason0x43
You can try running npm install again to make sure whatever husky needs is installed. If all else fails, use --no-verify when committing to skip the hook.
rhpijnacker
@rhpijnacker
I tried npm ci multiple times to no avail ...
I ended up shifting to my MacBook and did the same all over again, and it just worked.
Don't you just love Windows ...?
rhpijnacker
@rhpijnacker
Also fixed my master, so the next PR should not be so much of a problem
Jason Cheatham
@jason0x43
:grinning:
rhpijnacker
@rhpijnacker
@jason0x43 Anything I should do to make the PR eligible for merging?
Jason Cheatham
@jason0x43
No, it looks good, I just want to run the functional tests.
rhpijnacker
@rhpijnacker
@jason0x43 Thanks for merging the fix. Do you plan on releasing a new npm version with this included?
Jason Cheatham
@jason0x43
Yup, I've just been doing a bit of cleanup.
rhpijnacker
@rhpijnacker
Great! And many thanks
dave-hart
@dave-hart
Hi, I want to run functional tests against an https application that has been setup with self signed certificates. How would I go about enabling the acceptSslCerts configuration option?
dave-hart
@dave-hart
I am running with node and javascript, passing a configuration object to intern.configure
Jason Cheatham
@jason0x43

I believe just passing acceptSslCerts: true as part of an environment config might work, like

  { "browser": "chrome", "acceptSslCerts": true }

or

{
  "capabilities": { "acceptSslCerts": true },
  "environments": [ { "browser": "chrome" } ]
}

if you want the flag to apply to all environments.

dave-hart
@dave-hart

@jason0x43 thanks for the reply.
I have tried both of those options. My config and executor look like:

import intern from 'intern';
intern.configure({
  tunnelOptions: {
    version: '3.141.59',
    drivers: [
      {
        browserName: 'chrome',
        browserVersion: '96',
        browserDriver: '96.0.4664.45',
      },
    ],
    verbose: true,
  },
  environments: [
    {
      browserName: 'chrome',
      version: '96',
    },
  ],
  capabilities: { acceptSslCerts: true },
  functionalSuites: glob.sync('tests/**/all.js', { cwd: __dirname }),
  serverPort: 9100,
  debug: true,
  socketPort: 9101,
});
intern.run();

The browser doesn't seem to navigate to my https url, and with debug turned on I see

16:54:47.644 DEBUG [HttpURLConnection.writeRequests] - sun.net.www.MessageHeader@3ec878bb7 pairs: {GET /session/4764da1b1668bb09a3385856fd820ca3/window_handle HTTP/1.1: null}{User-Agent: axios/0.21.4}{Accept: application/json,text/plain;q=0.9}{Cache-Control: no-cache}{Pragma: no-cache}{Host: localhost:2429}{Connection: keep-alive}
16:54:47.644 DEBUG [HttpURLConnection.getInputStream0] - sun.net.www.MessageHeader@130d76443 pairs: {null: HTTP/1.1 200 OK}{Content-Length: 111}{Content-Type: application/json; charset=utf-8}
16:54:47.644 DEBUG [ReverseProxyHandler.execute] - To downstream: {"sessionId":"4764da1b1668bb09a3385856fd820ca3","status":0,"value":"CDwindow-B941B6A3B41A4B6618BB934A3A6B891B"}
16:54:47.669 DEBUG [WebDriverServlet.handle] - Found handler: 4764da1b1668bb09a3385856fd820ca3 (org.openqa.selenium.chrome.ChromeDriverService)
16:54:47.669 DEBUG [WebDriverServlet.lambda$handle$0] - Handler thread for session 4764da1b1668bb09a3385856fd820ca3 (chrome): Executing POST on /session/4764da1b1668bb09a3385856fd820ca3/window/rect (handler: ServicedSession)
16:54:47.670 DEBUG [ReverseProxyHandler.execute] - To upstream: {"x":0,"y":0,"width":1330,"height":1024}
16:54:47.670 DEBUG [HttpURLConnection.writeRequests] - sun.net.www.MessageHeader@3089c43c9 pairs: {POST /session/4764da1b1668bb09a3385856fd820ca3/window/rect HTTP/1.1: null}{User-Agent: axios/0.21.4}{Accept: application/json,text/plain;q=0.9}{Content-Type: application/json; charset=utf-8}{Cache-Control: no-cache}{Pragma: no-cache}{Host: localhost:2429}{Connection: keep-alive}{Content-Length: 40}
DEBUG: Suite errored with non-skip error self signed certificate

Which is leading me to think it is a self signed certs issue

Jason Cheatham
@jason0x43
Hmmm...apparently the more modern option is acceptInsecureCerts, so give that a try.
Deno Vichas
@denov
@jason0x43 - what chrome driver is in intern 4.10.1 / digdug 2.6.2? it looks like it's at 95. how does one get 97+?
Deno Vichas
@denov
SeleniumTunnel.js is pointing to https://theintern.io/digdug/resources/2/webdrivers.json. can you override this locally?
Jason Cheatham
@jason0x43

You can pin a driver version in an intern config with the tunnelOptions property, like:

"tunnelOptions": {
  "drivers": [
    { "name": "chrome", "version": "97.0.4692.71" }
  ]

And I'll update the webdrivers.json.

Deno Vichas
@denov
thx
rhpijnacker
@rhpijnacker
It is possible to host Intern (and the websocket used to communicate with the browser) on a secure channel?
rhpijnacker
@rhpijnacker
Or alternatively, can we get intern to forward certain URLs to an external API?
Jason Cheatham
@jason0x43
You should be able to run intern behind an https proxy (although it's been a while since I set that up).
rhpijnacker
@rhpijnacker
Not sure what you mean with that. Intern itself can not be started on a secure channel?
What happens with the secure web-socket is we run it being an https proxy?
Jason Cheatham
@jason0x43
Maybe I'm not understanding what you mean by a secure channel. Intern doesn't have any built-in support for https; there's no way to have it start an https server or to provide it with a key or cert. Intern can be run behind an HTTPS proxy, and it's serverUrl property can be pointed at that. If Intern's serverUrl address is https, it will try to open its websocket connection over SSL as well.
rhpijnacker
@rhpijnacker
That answers the question. Thanks.
Slobodan Mišković
@slobo
Clicking "API" when viewing LeadFoot docs on https://theintern.io/docs.html (or visiting https://theintern.io/docs.html#Leadfoot/2/api directly) locks up both Firefox and Chromium on Linux.
3 replies
rogerrabbitz
@rogerrabbitz

@jason0x43 Do you know of any issues in Firefox with drag and drop? I have a set of suites that are failing in FireFox, and we used to use Chrome and the suites were fine.

The following code does not execute properly in Firefox. Nothing is dragged, and we don't get any errors at all, just assertion fails:

.findById(dragId)
    .moveMouseTo(0, 0)
    .click()
    .pressMouseButton()
    .moveMouseTo(null, 1, 1)
    .end()
Jason Cheatham
@jason0x43
I don't believe Selenium/WebDriver supports HTML5 drag and drop. The standard way to get around that is to use JavaScript to simulate the drag-and-drop operation.
1 reply