Skip to content
This repository was archived by the owner on Nov 24, 2018. It is now read-only.

Conversation

@cwohlman
Copy link

@cwohlman cwohlman commented Oct 5, 2017

Fixes #279 : Not sure if this is necessarily the best way to fix this, but it fixed my problem & also the test I added.

The goal here is to allow chromeless.screenshot() (and other commands) to run after a failed command.

Example use case is in the test.

Note: When I ran npm:test on my machine nothing passed either before or after the edits, might want to add some additional docs, not sure exactly what's going on there. Running the tests using npm run watch:test worked all right, though one of the tests didn't pass because I wasn't running chrome headless.

@skuridin
Copy link

skuridin commented Jan 8, 2018

Why there is no any feedback from maintainers? Looks like an important issue.

@adamyonk
Copy link

adamyonk commented Jan 15, 2018

This is a pretty huge roadblock. Unless I'm missing something, this issue makes this impossible:

const { Chromeless } = require("chromeless");

test(
  "check APM flow",
  async done => {
    const chromeless = new Chromeless({ waitTimeout: 10000 });
    try {
      const errors = await chromeless
        .clearCookies()
        .goto(URL)
        .wait("BAD SELECTOR")
        .evaluate(() => []);

      expect(errors.length).toBe(0);
    } catch (e) {
      console.log(e);
	  await browser.end(); // this never happens
    }

    await browser.end(); // this also doesn't happen
    done();
  },
);

Running this through jest causes the test to hang and the Chrome process never terminates (end is never run).

@guilhermedecampo
Copy link

Pretty important!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to handle errors with try/catch

4 participants