Testing: Re-enable and refactor login tests that don't use magic links #11666
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In #11283 we temporarily disabled all login and signup connected tests.
This PR re-enables the login tests that don't use magic links, since they should not have any issues on their own. It also refactors these tests to make the test steps clearer for each test.
Background: These tests were sometimes failing because the magic link tests rely on an activity test rule to be able to invoke the magic link intent directly, and that intent can't always be launched. (The cause for that is still under investigation.) Because the test rule for that intent is launched before every test in the
LoginTests
class, it can sometimes cause unrelated tests to fail. This PR keeps that test rule and the magic link login test disabled, so it shouldn't cause any issues for the re-enabled tests.As we work on the magic link issue, we could consider putting all tests that use magic links into their own class (rather than separating tests based on login and signup exclusively) so the test rule is only applied to tests that need it.
To test:
./gradlew :WordPress:connectedVanillaDebugAndroidTest
. (Note that local test runs include the WPScreenshotTest, which isn't included in the CI run. That test is currently failing, but it's also failing indevelop
and the failure is related to mocks, not login. We can fix that it a separate PR.)PR submission checklist:
RELEASE-NOTES.txt
if necessary.