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

Add cypress tests #145

Merged
merged 41 commits into from
Apr 11, 2022
Merged

Add cypress tests #145

merged 41 commits into from
Apr 11, 2022

Conversation

thrijith
Copy link
Member

@thrijith thrijith commented Mar 9, 2022

Description of the Change

  • Setup cypress automated testing

Closes #91

Alternate Designs

N/A

Possible Drawbacks

N/A

Verification Process

Checklist:

  • I have read the CONTRIBUTING document.
  • [ x My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests passed.

Changelog Entry

Credits

Props @

@jeffpaul
Copy link
Member

@thrijith what else is needed here to bring out of draft? (also, THANKS for helping on this!)

@jeffpaul jeffpaul added this to the 1.1.0 milestone Mar 11, 2022
@thrijith
Copy link
Member Author

@thrijith what else is needed here to bring out of draft? (also, THANKS for helping on this!)

Hi @jeffpaul, the last test ran successfully here https://github.com/10up/autoshare-for-twitter/runs/5512545638?check_suite_focus=true#step:8:155 but I am seeing issue with same test when run against different WP version, don't think it is due version but something else, I'll check and see how it goes and update the PR when ready, hope that works 🙂

cadic
cadic previously approved these changes Mar 14, 2022
Copy link
Contributor

@cadic cadic left a comment

Choose a reason for hiding this comment

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

reviewed by accident

@cadic cadic self-requested a review March 14, 2022 08:52
@iamdharmesh iamdharmesh mentioned this pull request Mar 18, 2022
6 tasks
@thrijith
Copy link
Member Author

Hi @jeffpaul

I have the test ready, but there are issues when it is running on GH actions, and the videos generated as part of the process doesn't help in pinpointing the issue here, would be really helpful if someone can take a look at this as well.

  • Initially the test were failing for all WP versions, but one passed when I ran it individually.

https://github.com/10up/autoshare-for-twitter/blob/feature/add-cypress-tests/.github/workflows/test.yml#L64-L68

@iamdharmesh
Copy link
Member

Hi @thrijith,

Test failure in minimum and trunk env issue is fixed now. You may continue now on this to make it ready for review.

Thanks

@thrijith
Copy link
Member Author

Test failure in minimum and trunk env issue is fixed now. You may continue now on this to make it ready for review.

@iamdharmesh awesome, thanks! also what was the issue though? I see you moved permalink setup to be done after env setup was that is?

I'll check the requirements in https://github.com/10up/autoshare-for-twitter/issues/91and see if anything new needs to be done here or not in sometime.

@iamdharmesh
Copy link
Member

@iamdharmesh awesome, thanks! also what was the issue though? I see you moved permalink setup to be done after env setup was that is?

@thrijith The issue is related to some file permissions when we specify custom WordPress version for wp-env in .wp-env.json or .wp-env-override.json. In this case .htaccess file couldn’t be created in the root folder of the testing website. This is a known issue and fixed by @cadic. So, I applied his solution here

@thrijith thrijith force-pushed the feature/add-cypress-tests branch from 1be7125 to 54ce129 Compare March 28, 2022 19:09
thrijith and others added 15 commits March 29, 2022 00:49
Update permission of test core version setting

Update description for edit page

Remove test for actual tweet test

Remove secrets passed in test action
Update tests and add  block editor and classic editor cypress tests
Remove wpacceptance

Pass env vars via command line option
Bumps [ajv](https://github.com/ajv-validator/ajv) from 6.10.2 to 6.12.6.
- [Release notes](https://github.com/ajv-validator/ajv/releases)
- [Commits](ajv-validator/ajv@v6.10.2...v6.12.6)

---
updated-dependencies:
- dependency-name: ajv
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [tar](https://github.com/npm/node-tar) from 4.4.8 to 4.4.19.
- [Release notes](https://github.com/npm/node-tar/releases)
- [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md)
- [Commits](isaacs/node-tar@v4.4.8...v4.4.19)

---
updated-dependencies:
- dependency-name: tar
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
Update upload artifact action for debugging

Update upload artifact action for debugging
Check if dialog is working in CI

Revert "Check if dialog is working in CI"

This reverts commit 85adb37.
Add composer to test run fix syntax

Set permalink for unique URL

Add helper function to get random text

Set video to true for testing

Revert "Set video to true for testing"

This reverts commit 1446c60.
…config to enable video

Rename test files for order

Add more time to check for tweet

Try fixing issue with tests in different WP versions

Add timeout before click and additional step for lower version metabox

Reduce timeouts in tests

Temporarily remove trunk from matrix tests

Revert "Temporarily remove trunk from matrix tests"

This reverts commit 1a5576b.
@thrijith thrijith mentioned this pull request Mar 29, 2022
2 tasks
@iamdharmesh
Copy link
Member

@thrijith considering your comment here #91 (comment), making this PR Ready for review.

@iamdharmesh iamdharmesh marked this pull request as ready for review March 30, 2022 04:31
Copy link
Contributor

@dinhtungdu dinhtungdu left a comment

Choose a reason for hiding this comment

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

@thrijith overall, the PR looks good to me, great work 🎉 !

I notice you use cy.wait quite often, can you try to reduce or eliminate the usage of timeout functions? Because using timeout is a signal of potential flaky tests.

@iamdharmesh iamdharmesh mentioned this pull request Apr 1, 2022
19 tasks
@iamdharmesh
Copy link
Member

Hi @dinhtungdu,

I have updated PR for utilizing our utils lib @10up/cypress-wp-utils and improved tests by removing wait and timeout-related stuff.

Please help to re-review it.

Thanks
cc: @thrijith

@iamdharmesh iamdharmesh requested a review from dinhtungdu April 11, 2022 10:13
@iamdharmesh iamdharmesh self-assigned this Apr 11, 2022
dinhtungdu
dinhtungdu previously approved these changes Apr 11, 2022
Copy link
Contributor

@dinhtungdu dinhtungdu left a comment

Choose a reason for hiding this comment

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

LGTM! Left an optional comment but pre-approving this! Thanks so much for the great work on this PR!

tests/cypress/integration/block-editor.test.js Outdated Show resolved Hide resolved
@iamdharmesh iamdharmesh requested a review from dinhtungdu April 11, 2022 11:49
@iamdharmesh iamdharmesh merged commit 4df6a36 into develop Apr 11, 2022
@iamdharmesh iamdharmesh deleted the feature/add-cypress-tests branch April 11, 2022 12:55
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.

Add acceptance tests
6 participants