Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

force print log options and fix finding out the failed cy.commands or… #4

Merged
merged 12 commits into from
Feb 18, 2020
Merged

force print log options and fix finding out the failed cy.commands or… #4

merged 12 commits into from
Feb 18, 2020

Conversation

zhex900
Copy link
Contributor

@zhex900 zhex900 commented Feb 12, 2020

I have added an option to force print logs even when all tests passes.

Also I have changed from using the last command as the failed test to use options.state to check if the command failed or not
Fixes #3

@zhex900
Copy link
Contributor Author

zhex900 commented Feb 12, 2020

If you are happy with this. I can update the README.

index.js Outdated Show resolved Hide resolved
@emuemiru
Copy link

This works wonder and exactly what my team need. Please kindly proceed with this.

@archfz
Copy link
Owner

archfz commented Feb 13, 2020

@zhex900 I have merged the tests into master. Please rebase and add a test for this case as well. You need to do an npm install in the tests directory and run npm run test. You will need a new cypress suite and in the test.js add a new test with mocha with the expectations.

@zhex900
Copy link
Contributor Author

zhex900 commented Feb 13, 2020

I will find some time to look at it over the weekend. My first open source contribution.

@archfz
Copy link
Owner

archfz commented Feb 13, 2020

Nice! It will wait your changes.

index.js Show resolved Hide resolved
@zhex900
Copy link
Contributor Author

zhex900 commented Feb 16, 2020

All done. I have fix the problem of incorrect labeling of failed commands.
Tests are done.

The only things I don't know how to test. When I put a text function in the response. Nothing got sent. response.body.text returns undefined.

    if (typeof body.text === 'function') {
      return await body.text();
    }

Copy link
Owner

@archfz archfz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zhex900 I already wrote the test for FETCH API response for cy route and it works. You don't need to test that. You need to test only your added feature: the printLogs: always option.

index.js Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
test/cypress/integration/printLogs.spec.js Outdated Show resolved Hide resolved
test/cypress/integration/happyFlow.js Outdated Show resolved Hide resolved
@zhex900
Copy link
Contributor Author

zhex900 commented Feb 16, 2020

All done. Please check.

@archfz
Copy link
Owner

archfz commented Feb 18, 2020

@zhex900 can you please check the remaining comments?

@zhex900
Copy link
Contributor Author

zhex900 commented Feb 18, 2020

@zhex900 can you please check the remaining comments?

Do you mean the README? I have updated that.

@archfz
Copy link
Owner

archfz commented Feb 18, 2020

No. The rest of the comments on the changes. Scroll up. There is one comment and one question.

@zhex900
Copy link
Contributor Author

zhex900 commented Feb 18, 2020

Sorry, I can't see any comments.

index.js Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
@archfz
Copy link
Owner

archfz commented Feb 18, 2020

@zhex900 Yes, sorry I actually did not relies that it was not submitted. You can check now.

@archfz archfz merged commit f43b483 into archfz:master Feb 18, 2020
@zhex900 zhex900 deleted the forcePrintLog branch February 18, 2020 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Potentially wrongly labeled failing command
3 participants