Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 23 14:11
    codecov-io commented #1176
  • Oct 23 12:29
    rhpijnacker opened #1176
  • Oct 15 19:55

    jason0x43 on master

    chore: update webdriver version… (compare)

  • Oct 15 15:10

    jason0x43 on gh-pages

    Update assets (compare)

  • Oct 14 12:10

    jason0x43 on 4.8

    Updating metadata for 4.8.8 Updating source version to 4.8.… (compare)

  • Sep 28 17:43
    jsf-clabot commented #10
  • Sep 25 01:02
    jason0x43 labeled #1173
  • Sep 25 01:02
    jason0x43 unlabeled #1173
  • Sep 25 01:01
    jason0x43 closed #1174
  • Sep 25 01:01
    jason0x43 commented #1174
  • Sep 25 01:00

    jason0x43 on 4.8

    fix: add missing dot for tsx fi… (compare)

  • Sep 25 01:00

    jason0x43 on master

    fix(core): add missing dot for … (compare)

  • Sep 25 00:50

    jason0x43 on master

    add missing dot for tsx file ex… (compare)

  • Sep 25 00:50
    jason0x43 closed #1175
  • Sep 23 07:37
    lxghtless edited #1174
  • Sep 23 07:35
    jsf-clabot commented #1175
  • Sep 23 07:35
    jsf-clabot commented #1175
  • Sep 23 07:35
    lxghtless opened #1175
  • Sep 23 07:31
    github-actions[bot] labeled #1174
  • Sep 23 07:31
    lxghtless opened #1174
sKudum
@sKudum
Hi Team, any one ran Jasmine typescripts on saucelab?
John Lindal
@jafl
Is there an easy way to get the parent of an Element?
Jason Cheatham
@jason0x43
There's not an API function for that, but you should be able to get it with an execute block:
const element = remote.findByCssSelector('.some-element');
const parentNode = await remote.execute(function (node) {
  return node.parentNode;
}, [element]);
John Lindal
@jafl
Thanks!
tillyboy
@tillyboy
Sry for the most noob question of the day but I am trying to set up a workflow (learning about Web Development) and it seems I can't intern to test against a browser. For Chrome it either says that the version is wrong, or that it cannot download 85.0 from the specified URL. Version 85.0 is however available from the official google API. With Firefox I get a suide error occured. Can anyone tell me how to set this up?
Jason Cheatham
@jason0x43
Hi! Hmmm...it looks like the default webdriver versions used by Intern had slipped a bit. If you're using the most recent Intern, I pushed an updated list of webdriver versions that Intern should see the next time you run it. If you want to specify a version, you can use the tunnelOptions property, like:
"tunnelOptions":: {
  "drivers": [ { name: "chrome", "version": "85.0.4183.87" } ]
}
tillyboy
@tillyboy
Ok, so now I get Chrome to start and do some random stuff, which seems good to me. However I get
Error: Unable to load /tests/box.spec.ts
at HTMLScriptElement.<anonymous> @ node_modules/intern/browser/remote.js:168:45068
No unit test coverage for chrome on linux
Jason Cheatham
@jason0x43
TypeScript isn't (yet) supported in browsers, so you'll need to build your tests first. For example, using webpack, create a bundle that includes all of your unit tests, and then use that bundle in the browser. You can provide separate suites lists for Node and Browsers to keep using the TS suites in Node:
// intern.json
{
  "node": {
    "suites": "tests/**/*.ts"
  },
  "browser": {
    "suites": "build/tests.js"
  }
}
Dylan Staley
@dstaley
Just wanted to drop a note about this again. I'm constantly seeing test failures where Intern is unable to connect to Firefox on GitHub Actions. Any idea if this is a Firefox, GHA, or Intern issue? https://github.com/Kinto/kinto.js/runs/1167315492
Timeout: [POST http://localhost:4444/wd/hub/session / [...snip...] connection refused
Jason Cheatham
@jason0x43
Does it fail every time, or just frequently? Also, what version of Intern are you using?
Dylan Staley
@dstaley
Frequently, but not every time. I'd say it's about 50% of the time. I'm using v4.8.7.
Dylan Staley
@dstaley
I also just realized that this is on Windows. I'm gonna update our CI to run the browser tests on Linux to see if that increases stability.
Jason Cheatham
@jason0x43
That'd be great. Also, have the failures been happening for a while, or did they start relatively recently?
Dylan Staley
@dstaley
Should @theintern/digdug have semver listed as a dependency since it's being used here? https://github.com/theintern/digdug/blob/master/src/SeleniumTunnel.ts#L18
Running into an issue where semver isn't being found https://github.com/dstaley/ssgen/pull/4/checks?check_run_id=1216741708
Dylan Staley
@dstaley
Ah nevermind, after removing node_modules and package-lock.json it seems to have corrected itself!
rhpijnacker
@rhpijnacker
Trying to set up a self-hosted Selenium grid to run unit tests on Chrome, Safari, Edge and IE11.
For Chrome I can pass in a "start-maximized" argument to the webdriver to make the browser go full screen.
Is there a way to do something similar on Safari and/or IE11?
rhpijnacker
@rhpijnacker
Or, instead of maximized, to a fixed size, e.g. 1280x1024
Jason Cheatham
@jason0x43
I don't think that IEDriverServer or safaridriver will let you start a browser maximized , but you could call setWindowSizeor maximizeWindow in a before or beforeEachcall.
rhpijnacker
@rhpijnacker
For that it would need to be a functional test, I'm running unit tests.
Thanks anyway.
Jason Cheatham
@jason0x43
Hmmm...you could, in a plugin, listen for suiteStart events. When the starting suite is a session suite, you'll have access to the suite's remote object, at which point you could send a maximize command.
rhpijnacker
@rhpijnacker
Thanks, I'll give that a try
rhpijnacker
@rhpijnacker

The following plugin:

intern.on('suiteStart', suite => suite.remote && suite.remote.session.maximizeWindow());

works like a charm on IE11.
But on Safari it throws an error:

UnknownCommand: [POST http://130.145.143.139:4444/wd/hub/session/81AE85DB-218D-4607-8411-717638D3659D/window/current/maximize] The command 'POST /session/81AE85DB-218D-4607-8411-717638D3659D/window/current/maximize' was not found.
rhpijnacker
@rhpijnacker
Oh ... and Chrome says:
InvalidArgument: [POST http://130.145.143.139:4444/wd/hub/session/64e3cad15d80cdc54205631f4fc393d8/window/current/maximize] invalid argument: missing command parameters
Am I doing something wrong?
rhpijnacker
@rhpijnacker
Other question: when I press Ctrl-C in the runner, I see that the browsers in the self-hosted grid keep running. I'm trying to locate the cleanup code to close the browsers, but so far I cannot seem to find it. I did see a SIGINT handler in the Tunnel.js , but for the NullTunnel it looks like we skip that.
rhpijnacker
@rhpijnacker
@jason0x43 A while back I was looking at problems running on BrowserStack on IE11. We get messages in the browser about sendData timeouts.
Since this timeout seems to do no harm (the ACK gets through in the end, just not in the time allowed for it), but the messages in the DOM interfere with our tests, I was considering ways to remove them.
One possibility would be to add a 'before' hook that clears the DOM, so every test suite starts with an empty DOM. Unfortunately that does not seem to work. Doing this in 'testStart' does not work either, since the setup done in 'beforeEach' functions may be undone.
Any thoughts?
Jason Cheatham
@jason0x43

There's actually a config option that might be helpful there:

{
  "remoteOptions": {
    "disableDomUpdates": true
  }
}

Setting that will tell the remote runner to disable the Dom reporter.

rhpijnacker
@rhpijnacker
Hehe, I know (since I implemented that myself).
However, that does not stop the "Sending testStart failed: WebSocket error" messages that occur when the connection with the WebSocket is delayed.
rhpijnacker
@rhpijnacker
I ran some tests just now to mimic the sendData/ACK round trip, in combination with a busy test case. From this I draw the following conclusion:
If you run a test case that fully occupies the event-loop (even with setTimeout(..., 0) calls in there) then on Chrome websocket message events are still handled within a short amount of time (tenths of msec range). However on IE11 it will take considerably longer for websocket message events to be handled. The round-trip times are quickly growing depending on the way you keep the event loop busy.
I think that this is the root cause of the problems I am seeing. Some of the tests we have (written on top of the the intern-cucumber plugin) will exhibit this kind of behaviour, expaining the >10sec timeout for the ACK message to be processed (I can see it still is, just way later than expected).
My efforts so far have been to add setTimeout(..., 0) statements on strategic places, but apparently on IE11 that does not help.
rhpijnacker
@rhpijnacker
As an alternative workaround, I will set the timeout on the WebSocket to a much larger value. Put in #1176 so we can pass this in from the outside.
rhpijnacker
@rhpijnacker
@jason0x43 Any suggestions for the "maximize" issues?
Deno Vichas
@denov
what's the best way to grab and store an attribute value from a node to use later. is it possible to use a page object for this?
Jason Cheatham
@jason0x43
@rhpijnacker At the moment, just my earlier suggestion to try a plugin. To make that a bit cleaner, we could add an event specifically to notify the local executor that a remote session suite was starting to give it a chance to run any webdriver-based setup.
rhpijnacker
@rhpijnacker
I did try that plugin. But the maximizeWindow() call was giving errors on Safari and Chrome.
Any reason why it would do that?
Jason Cheatham
@jason0x43
@denov If you're using async/await, something like const value = await remote.findByCssSelector('node').getAttribute('some-attr'). You could certainly also use a page object for that.
@rhpijnacker Oh, yes. Hmmm....
Is leadfoot running feature tests? maximizeWindow is one the commands that differs between JWP and WebDriver, and it relies on a feature test to determine which command format to use.
rhpijnacker
@rhpijnacker
No, we turned off the feature tests to make the initialization faster.
Should we turn it on again?
Jason Cheatham
@jason0x43
Try that and see if it takes care of the issue. One of the tasks on the infinite todo list is to move most/all of the initial feature checks into the commands themselves (so each command, when run the first time, will fix its behavior for future usages) to speed things up.
rhpijnacker
@rhpijnacker
ok, will do
For now, I hope #1176 will workaround the IE11 issues, so we can finally start using this for our tests.
Deno Vichas
@denov
@jason0x43 when using const value = await i have to break the remote chain. is there anyway to get this value into the chain scope? would using getter/setter work?
and how does one call a helper function from other inside page object.
i have a clickTab helper, i would like to have something like toggleTabs where it would call clickTab twice. i can't figure out how to get things scoped corretly