Skip to content

Conversation

@emmaoke-w
Copy link
Contributor

@emmaoke-w emmaoke-w commented Jan 12, 2026

TaskWPB-22314 [Android/QA]Refactor tests to include readable step-based reporting with Allure


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

  • Refactored UI tests to introduce explicit Allure test steps that closely reflect real user actions
  • Remove global ClientUserManager singleton pattern that causes state leakage between tests(Test users (e.g. user1Name) were reused across multiple test classes.
  • Each test now creates and owns its own instance of ClientUserManager, which is shared only within the scope of that test via TeamHelper.
  • Tests can now run sequentially
  • Replaced nullable infrastructure fields with lateinit where they are always initialized in setUp()
  • Removed unsafe !! null assertions
  • Restricted test-only fields to private to prevent accidental external access

Issues

Briefly describe the issue you have solved or implemented with this pull request. If the PR contains multiple issues, use a bullet list.

  • Refactored UI tests to introduce explicit Allure test steps that closely reflect real user actions and system boundaries.
  • Remove global ClientUserManager singleton pattern that causes state leakage between tests(Test users (e.g. user1Name) were reused across multiple test classes.
  • Each test now creates and owns its own instance of ClientUserManager, which is shared only within the scope of that test via TeamHelper.
  • Tests can now run sequentially
  • Replaced nullable infrastructure fields with lateinit where they are always initialized in setUp()
  • Removed unsafe !! null assertions
  • Restricted test-only fields to private to prevent accidental external access

Causes (Optional)

Briefly describe the causes behind the issues. This could be helpful to understand the adopted solutions behind some nasty bugs or complex issues.

Solutions

Briefly describe the solutions you have implemented for the issues explained above.

Dependencies (Optional)

If there are some other pull requests related to this one (e.g. new releases of frameworks), specify them here.

Needs releases with:

  • GitHub link to other pull request

Testing

Test Coverage (Optional)

  • I have added automated test to this contribution

How to Test

Briefly describe how this change was tested and if applicable the exact steps taken to verify that it works as expected.

Notes (Optional)

Specify here any other facts that you think are important for this issue.

Attachments (Optional)

image image

Attachments like images, videos, etc. (drag and drop in the text box)


PR Post Submission Checklist for internal contributors (Optional)

  • Wire's Github Workflow has automatically linked the PR to a JIRA issue

PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

@pull-request-size
Copy link

Ups 🫰🟨

This PR is too big. Please try to break it up into smaller PRs.

@emmaoke-w emmaoke-w changed the title test: add allure test steps and removed global ClientUserManager singleton pattern (WPB-22314) test: add allure test steps and removed global clientUserManager singleton pattern(WPB-22314) Jan 12, 2026
Copy link
Contributor

@yamilmedina yamilmedina left a comment

Choose a reason for hiding this comment

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

left some comments, looking good

@Suppress("CyclomaticComplexMethod", "LongMethod")
@TestCaseId("TC-8603")
@Category("criticalFlow")
@Category("criticalFlow", "testTest")
Copy link
Contributor

Choose a reason for hiding this comment

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

is this "testTest" needed ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for spotting this, I only used the "testTest" for testing

@Suppress("CyclomaticComplexMethod", "LongMethod")
@TestCaseId("TC-8605")
@Category("criticalFlow")
@Category("criticalFlow", "testTest")
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here, "testTest" does not seem descriptive. maybe leaked into the final PR ?

Comment on lines 211 to 217
// fun waitUntilLoginFlowIsCompleted(): RegistrationPage {
// val device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
// waitUntilElementGone(device, loginButtonGoneSelector, timeoutMillis = 12_000)
// waitUntilElementGone(device, settingUpWireGoneSelector, timeoutMillis = 35_000)
// return this
// }

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// fun waitUntilLoginFlowIsCompleted(): RegistrationPage {
// val device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
// waitUntilElementGone(device, loginButtonGoneSelector, timeoutMillis = 12_000)
// waitUntilElementGone(device, settingUpWireGoneSelector, timeoutMillis = 35_000)
// return this
// }
// fun waitUntilLoginFlowIsCompleted(): RegistrationPage {
// val device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
// waitUntilElementGone(device, loginButtonGoneSelector, timeoutMillis = 12_000)
// waitUntilElementGone(device, settingUpWireGoneSelector, timeoutMillis = 35_000)
// return this
// }

import uiautomatorutils.UiWaitUtils.WaitUtils.waitFor

@RunWith(AndroidJUnit4::class)
class FileSharing : BaseUiTest() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion/question: I'm wondering if this test class should be renamed to something like: FileSharingBetweenTeams. Since it looks to me it's what we are actually doing in here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Collaborator

@CinnamonNinja CinnamonNinja left a comment

Choose a reason for hiding this comment

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

Looks good to me! Left some minor suggestions.

}
}

step("Fetch email verification link from Inbucket") {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it good to mention inbucket in open source code? Can we maybe just reduce it to "Fetch email verification link"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have removed the inbucket

iMinimiseOngoingCall()
}
}
step("Send chat message 'Hello Friends' from user2") {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this name need to contain the message and user? Or can it be more generic?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

false
)
}
step("Share location from user3 and verify call continues") {
Copy link
Collaborator

Choose a reason for hiding this comment

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

also here, do we need to mention the user specifically? Or can it be more generic?

assertTermsOfUseModalVisible() // Asserts all elements
clickContinueButton()
// These values are pulled from BuildConfig injected from secrets.json)
step("Fetch OTP from Inbucket to complete 2FA verification and complete registration") {
Copy link
Collaborator

Choose a reason for hiding this comment

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

also here, can we remove Inbucket and instead just use "Fetch OTP to complete 2FA verification and complete registration"?

@sonarqubecloud
Copy link

@emmaoke-w emmaoke-w requested a review from yamilmedina January 14, 2026 16:09
@emmaoke-w emmaoke-w enabled auto-merge January 14, 2026 16:19
@emmaoke-w emmaoke-w added this pull request to the merge queue Jan 14, 2026
Merged via the queue into develop with commit df76f51 Jan 14, 2026
13 of 14 checks passed
@emmaoke-w emmaoke-w deleted the test/WPB-22314-add-allure-test-steps branch January 14, 2026 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants