xolvio / qualityfaster

An example project showing how to create robust and maintainable acceptance tests
262 stars 58 forks source link

taking screenshots of failed steps with chimp #34

Closed Alino closed 8 years ago

Alino commented 8 years ago

please could you tell me, how should I tell chimp to take screenshots on circleCI?

I tried this in start.js

if (process.env.CIRCLECI) {
  chimpSwitches +=
  ' --screenshotsPath=' + path.resolve(process.env.CIRCLE_ARTIFACTS) + '/chrome' +
  ' --screenshotsOnError';
}

and this is how I call chimp in circle.yml

test:
  pre:
    - mkdir -p $CIRCLE_TEST_REPORTS/cucumber
  override:
    - mkdir -p $CIRCLE_ARTIFACTS/chrome
    - touch $CIRCLE_ARTIFACTS/chrome/something.txt

    # CHIMP CUCUMBER - Test the app with Chrome
    - cd app && npm run ci:
        environment:
          MONGO_URL: "mongodb://127.0.0.1:27018/kuknito"
          MONGO_OPLOG_URL: "mongodb://127.0.0.1:27018/local"
          CUCUMBER_JSON_OUTPUT: "$CIRCLE_TEST_REPORTS/cucumber/chrome.cucumber"

however screenshots won't get created and I don't know why :(

workflow commented 8 years ago

Looks like you're doing everything right to me. There were some troubles with taking images in the last versions of chimp (https://github.com/xolvio/chimp/issues/290), have you tried upgrading to the latest version (0.33.1) yet?

ghost commented 8 years ago

Using Chimp 0.33.1 with this snippet definitely works: https://github.com/xolvio/automated-testing-best-practices/blob/master/.scripts/start.js#L54-L56.

My test build was https://circleci.com/gh/xolvio/automated-testing-best-practices/109#artifacts.

Alino commented 8 years ago

thank you, I was using version 0.30.0