hiptest / hiptest-publisher

Publisher for CucumberStudio projects
MIT License
47 stars 63 forks source link

Add support for Cypress #93

Open aurelien-reeves opened 6 years ago

aurelien-reeves commented 6 years ago

Add support for Javascript End to End testing framework Cypress website: https://www.cypress.io/

trannguyenhung011086 commented 6 years ago

+1 for this. I am using Cypress for E2E testing and it is very quick compared with Selenium.

asos-elyochola commented 6 years ago

+1 for this too

benmardana commented 6 years ago

+1 for adding Cypress integration.

Yogeshango commented 6 years ago

+1 Will love to see cypress integration.

evelynef commented 6 years ago
oscarkwan commented 6 years ago

+1 !

aepplerplangrid commented 6 years ago

+1

tk-o commented 6 years ago

Just wondering: Cypress ~understands ~Jasmine format~ is built on top of Mocha, what's prevents you guys from using this format?

superwinter commented 6 years ago

+1

tk-o commented 6 years ago

I have a question. What do people expect from a cypress integration?

I've been using cypress in tests generated by hiptest-publisher and all works fine. Here's my config file I use while generating tests:

token = 'your-project-token-here'
language = 'javascript'
framework = 'mocha'
output_directory = 'cypress/integration'
with_folders = 'true'
push_format = 'junit'

And cypress.json file looks like this:

{
  "baseUrl": "https://www.example.com",
  "ignoreTestFiles": "actionwords*",
  "reporter": "junit",
  "reporterOptions": {
    "mochaFile": "cypress/reports/report-[hash].xml"
  }
}

You may want to ignore generated test files. My .gitignore file looks like this:

# generated test artefacts
cypress/integration
!cypress/integration/actionwords*
cypress/screenshots
cypress/reports

I use Makefile to run the tasks in my project, here it is:

generate-actionwords:
  hiptest-publisher --config-file=ht.config --actionwords-only

erase-tests:
  rm -rf cypress/reports cypress/integration/**/*test.js

ci:
  npx cypress run

ci-with-hiptest:
  - make erase-tests
  - hiptest-publisher -c ht.config --only=tests --test-run-id=${test-run-id}
  - make ci
  - hiptest-publisher -c ht.config --push="cypress/reports/*.xml" --test-run-id=${test-run-id}

And that's it, the below task works like a charm ✅ make ci-with-hiptest test-run-id=12345

Feel free to ask in case of any questions 🙃

RonyVidaur commented 5 years ago

@kopacki when you run the tests it updates the test on your hiptest dashboard?

tk-o commented 5 years ago

Yes, this line handles it: hiptest-publisher -c ht.config --push="cypress/reports/*.xml" --test-run-id=${test-run-id}

xviuda-rhm commented 5 years ago

@kopacki can you explain how this works. if i use the hiptest-publisher -c ht.config --only=tests --test-run-id=${test-run-id} command, i will just get an testfile that has Todo implement action.

This mean cypress cant run it because its empty. And since you delete everything in your erase-tests step i dont understand how this will work.

etmjansen commented 5 years ago

+1

tk-o commented 5 years ago

Hello again, first you have to run generate- actionwords command which downloads the actionwords only.

matheuseabra commented 5 years ago

+1 for Cypress integration!

matheuseabra commented 5 years ago

hiptest-publisher --config-file=ht.config --actionwords-only

I have a couple questions regarding this integration with Cypress:

  1. why is it necessary to erase the cypress/reports cypress/integration/**/*test.js tests between generating the action words and exporting the test runs from Hiptest?

  2. After generating action words from Hiptest to the javascript/mocha format, should'nt the execution of these scripts be async? Since the dev must implement the body of the generated functions first before running npx cypress run?

Thanks @kopacki

alastair-todd commented 5 years ago

that's me out :( I've no idea why a product such as HipTest should be tied to any kind of test runner - at the most to the Cucumber framework yes. I don't get it.

jsifalda commented 3 years ago

@tk-o how do you structure your test cases? i guess you use action words in order to be able to use hiptest uploader? is it possible to use it without actionwords?

tk-o commented 3 years ago

@tk-o how do you structure your test cases? i guess you use action words in order to be able to use hiptest uploader? is it possible to use it without actionwords?

It's been a while since the last time I used Hiptest, so unfortunately, I won't be able to answer this question. Back it the day, I think the actionwords were required, not sure what's been like recently.