by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Aug 10 13:33

    jason0x43 on master-mono

    fix(cli): don't overwrite confi… test(leadfoot): temporarily dis… (compare)

  • Jul 29 20:50
    jsf-clabot commented #1171
  • Jul 29 20:50

    dependabot[bot] on npm_and_yarn

    build(deps): bump elliptic from… (compare)

  • Jul 29 20:50
    dependabot[bot] labeled #1171
  • Jul 29 20:50
    dependabot[bot] opened #1171
  • Jul 21 01:52
    jason0x43 closed #1170
  • Jul 21 01:52
    jason0x43 commented #1170
  • Jul 21 01:40
    jason0x43 closed #1165
  • Jul 21 01:40

    jason0x43 on monorepo

    (compare)

  • Jul 17 11:44
    github-actions[bot] labeled #1170
  • Jul 17 11:42
    sridattasp opened #1170
  • Jul 15 21:15

    dependabot[bot] on npm_and_yarn

    (compare)

  • Jul 15 21:15
    jsf-clabot commented #86
  • Jul 15 21:15
    dependabot[bot] closed #85
  • Jul 15 21:15
    dependabot[bot] commented #85
  • Jul 15 21:15
    dependabot[bot] labeled #86
  • Jul 15 21:15

    dependabot[bot] on npm_and_yarn

    Bump lodash from 4.17.11 to 4.1… (compare)

  • Jul 15 21:15
    dependabot[bot] opened #86
  • Jul 15 20:50
    jsf-clabot commented #190
  • Jul 15 20:50
    dependabot[bot] labeled #190
Jason Cheatham
@jason0x43

Funny, someone else just pinged me because GHA recently updated to Chrome 83 and their tests started failing. :grinning: Intern's policy is to track the current stable versions of webdrivers by default. If you need to pin to a specific driver version, you can do that using tunnelOptions.drivers:

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

We can actually make that a bit easier with GHA, because (at least according to their release notes) they publish something to a CHROMEWEBDRIVER environment variable in the container. I haven't checked to see what that contains, though (path to an exe, version number, ...).

Dylan Staley
@dstaley
oh huh maybe it's failing because Chrome is actually v83 and ChromeDriver can't properly detect it?
Jason Cheatham
@jason0x43
4.8.4 uses the chromedriver for Chrome 81 by default, so you'd need to pin to a v83 chromedriver. Intern 4.8.5 (published yesterday) checks for updated webdriver versions when you run tests, so it should stay up-to-date.
Dylan Staley
@dstaley
Oh, sorry, it's actually v4.8.5 that's breaking
This version of ChromeDriver only supports Chrome version 83
Jason Cheatham
@jason0x43
Ah, yeah, being on 4.8.5 would make more sense with that error.
It looks like you're using a Windows environment?
Dylan Staley
@dstaley
Yup, the Windows 2019 environment, which as of seven days ago is using chrome 81 (at least according to this https://github.com/actions/virtual-environments/blame/master/images/win/Windows2019-Readme.md#L573)
Jason Cheatham
@jason0x43
Hmm...the release notes for the most recent release (3 days ago) says it's on Chrome 83. (https://github.com/actions/virtual-environments/releases/tag/win19%2F20200524.1)
In any case. the solution is still to pin the chromedriver version to something compatible with the target environment.
It would be useful to be able to easily make use of the environment variable, though. The Windows release notes point out that it points to the driver exe. so that's useful to know. I'll create an issue for it...
Dylan Staley
@dstaley
So intern always downloads the latest version of the driver? Would it make sense to provide an option to download the driver that matches the installed version of Chrome?
Because I can pin to v81 to get tests passing now, but in a few days when the environment updates to v83 I'm gonna have the same issue.
I guess I could, in CI, interpolate the chrome version into the config?
Jason Cheatham
@jason0x43
Intern does download the latest version as that's the most common use case. Detecting the local version would be useful, but tricky, particularly if the browser being used was in a non-standard location.
Being able to use environment variables in the config would handle the GHA case (and would be generally useful). You can already use an INTERN_ARGS environment variable to pass command line options, but it's not very ergonomic for something like this.
Dylan Staley
@dstaley
So the best solution for right now would be updating the config with the value from the CHROMEDRIVER variable?
Jason Cheatham
@jason0x43
Unfortunately, there isn't a way to configure a path to a local webdriver executable, so the best solution for the moment is to pin the version in the config. Depending on the format of their CHROMEWEBDRIVER variable, you might be able to extract the local version from that and use it to set the webdriver version.
Dylan Staley
@dstaley
Yeah that's what I'll try. I'll report the format in the issue
Jason Cheatham
@jason0x43
:thumbsup:
Dylan Staley
@dstaley
Wait, it looks like GHA is installing ChromeDriver in addition to Chrome. Can intern pick up on that since it's in the PATH?
Dylan Staley
@dstaley
Ah okay nevermind, looks like the issue encompasses updating digdug to accept a path to an executable
Dylan Staley
@dstaley
When pinning a webdriver version, should tunnelOptions go at the root of the config?
Jason Cheatham
@jason0x43
Yes.
{
  "tunnelOptions": {
    "drivers": [ { "name": "chrome", "version": "81.xxx" } ]
  }
}
MarvDann
@MarvDann
Hi Jason, what is the recommended way to mock api requests in intern 3? I have tried using nock but was unable to import it as a module after using bower to install it as a package alongside dojo in /src folder
Scott Davis
@stdavis
image.png
So I have unit tests running in the browser. How do I get those to run in a headless browser on my CI server?
Jason Cheatham
@jason0x43
@MarvDann If you're using dojo for requests, you can mock the request handling during tests. If you're using something else, you could try Sinon, which provides facilities for mocking XHR requests.
Jason Cheatham
@jason0x43
@stdavis In a CI system, you'd run Intern from the command line, and use the Selenium tunnel (assuming the browser is on your CI system) to load and manage the browser. In your Intern config, you'd setup an environment for headless chrome (see https://theintern.io/docs.html#Intern/4/docs/docs%2Fhow_to.md/run-tests-with-headless-chrome). Note that your CI system would need Java (headless Java is fine) to run Selenium. If Java isn't an option, you can also interact with chromedriver directly, but it's a bit more work (better support for direct interaction with web drivers is in the works).
1 reply
Dylan Staley
@dstaley
Is Firefox on GitHub Actions really flaky? I feel like every third run fails with Timeout: [POST http://localhost:4444/wd/hub/session / {"desiredCapabilities":{"name":"intern","idle-timeout":60,"browserName":"firefox","moz:firefoxOptions":{"args":["-headless"],"browser":"firefox"}}] connection refused
rhpijnacker
@rhpijnacker
Since upgrading from Intern 3 to Intern 4 we have a number of files that have (much) lower code coverage.
I've been able to chase this down to test cases that use a (dojo) context require with a map to reroute dependencies to mock files. After the test case is finished, we clean up the loaded module (using require.undef) to force-load it (without mocked dependencies) the next time it is needed.
It seems that reloading a module with Intern 4 resets the coverage built up so far, whereas with Intern 3 this wasn't the case.
Any thoughts on how to work around this? Do we even consider this a bug?
Jason Cheatham
@jason0x43
I'd call that a bug. At least, I would expect coverage to be cumulative over the course of a test session.
rhpijnacker
@rhpijnacker
Ok, filed an issue with repro
Jason Cheatham
@jason0x43
Awesome, thanks
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!