-
Notifications
You must be signed in to change notification settings - Fork 24
chore: multibackend service test - WPB-19855 #3549
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
Merged
Merged
Changes from 11 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
91abb53
multibackend service test
findms d160241
changes related 2nd backend: anta
findms 74456d2
verification added.
findms b939c28
Merge branch 'develop' into chore/test-multi-backend-support
findms fff8ceb
conflicts
findms 5abd353
Merge branch 'develop' into chore/test-multi-backend-support
findms 19b00c3
Merge branch 'develop' into chore/test-multi-backend-support
findms 42cc522
enabling multibackend and fixign the tests
findms f3f0879
fixed the setting current backend at the end of test
findms 66b9799
revert submodule
findms bb94ab9
pr feedback improvements
findms 539336b
PR feedbacks
findms 3ac4995
few more pr feedbacks
findms eb62831
refactor
netbe 1f7b7fc
formatting
findms 1837096
added missing urls
findms 46af4f7
Merge branch 'develop' into chore/test-multi-backend-support
findms 78be4f4
fixed a test
findms File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| // | ||
| // Wire | ||
| // Copyright (C) 2025 Wire Swiss GmbH | ||
| // | ||
| // This program is free software: you can redistribute it and/or modify | ||
| // it under the terms of the GNU General Public License as published by | ||
| // the Free Software Foundation, either version 3 of the License, or | ||
| // (at your option) any later version. | ||
| // | ||
| // This program is distributed in the hope that it will be useful, | ||
| // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| // GNU General Public License for more details. | ||
| // | ||
| // You should have received a copy of the GNU General Public License | ||
| // along with this program. If not, see http://www.gnu.org/licenses/. | ||
| // | ||
|
|
||
| import Foundation | ||
|
|
||
| public enum BackendContext { | ||
| public static var current: BackendTarget = .staging | ||
| } | ||
|
|
||
| public enum BackendTarget { case staging, anta } | ||
netbe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,112 @@ | ||
| // | ||
| // Wire | ||
| // Copyright (C) 2025 Wire Swiss GmbH | ||
| // | ||
| // This program is free software: you can redistribute it and/or modify | ||
| // it under the terms of the GNU General Public License as published by | ||
| // the Free Software Foundation, either version 3 of the License, or | ||
| // (at your option) any later version. | ||
| // | ||
| // This program is distributed in the hope that it will be useful, | ||
| // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| // GNU General Public License for more details. | ||
| // | ||
| // You should have received a copy of the GNU General Public License | ||
| // along with this program. If not, see http://www.gnu.org/licenses/. | ||
| // | ||
|
|
||
| import XCTest | ||
|
|
||
| final class MultiBackendSupportTests: WireUITestCase { | ||
|
|
||
| @MainActor | ||
| func test_Add_MultiBackend_Accounts() async throws { | ||
|
|
||
| defer { BackendContext.current = .staging } | ||
| let domainInfoStaging = "staging.zinfra.io" | ||
netbe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| let domainInfoAnta = "anta.wire.link" | ||
|
|
||
| let user_Backend1 = try await userHelper.createPersonalUser() | ||
netbe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| let firstTimePage = try app.loginUser(email: user_Backend1.email, password: user_Backend1.password) | ||
| var accountPage = try firstTimePage.acceptPopup() | ||
| .openSettings() | ||
| .openAccountSettings() | ||
|
|
||
| // Verify backend1-staging details | ||
| var accountName = try XCTUnwrap(accountPage.getAccountName()) | ||
| var domanInfo = try XCTUnwrap(accountPage.getDomainInfo()) | ||
netbe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| XCTAssertEqual(accountName, user_Backend1.name, "Account name didn't match \(user_Backend1.name)") | ||
| XCTAssertTrue( | ||
| accountPage.getUsername().contains(user_Backend1.username), | ||
| "Username didn't contain \(user_Backend1.username)" | ||
| ) | ||
| XCTAssertEqual(accountPage.getEmail(), user_Backend1.email, "Email didn't contain \(user_Backend1.email)") | ||
| XCTAssertEqual(domanInfo, domainInfoStaging, "Domain info \(domanInfo) mismatched on account page") | ||
|
|
||
| _ = try accountPage.backToSettings() | ||
| .switchToConversationsTab() | ||
| .openUserAccountPageForUser(with: user_Backend1.name) | ||
| .tapAddAccountOrTeamButton() | ||
|
|
||
| let deeplink = try EnvironmentVariables().antaDeepLinkURL | ||
| setCustomBackend(byDeeplink: deeplink, domainInfo: domainInfoAnta) | ||
| BackendContext.current = .anta | ||
|
|
||
| // Register for backend2 - anta | ||
| let user_Backend2 = UserGenerator.generateUniqueUserInfo() | ||
netbe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| let welcomePage = try WelcomePage() | ||
|
|
||
| let createPersonalAccountFormPage = try welcomePage | ||
| .enterEmailOrSSO(user_Backend2.email) | ||
| .tapCreatePersonalAccountLink() | ||
|
|
||
| let verificationPage = try createPersonalAccountFormPage | ||
| .enterName(user_Backend2.name) | ||
| .enterPassword(user_Backend2.password) | ||
| .enterConfirmPassword(user_Backend2.password) | ||
| .tapContinueButton() | ||
| .tapAcceptButton() | ||
|
|
||
| let verificationCode = try await InbucketClient.getVerificationCode(email: user_Backend2.email) | ||
|
|
||
| let setUsernamePage = try verificationPage | ||
| .enterVerificationCodeAndConfirm(verificationCode) | ||
|
|
||
| accountPage = try setUsernamePage | ||
| .setUsername(user_Backend2.username) | ||
| .openSettings() | ||
| .openAccountSettings() | ||
|
|
||
| // Verify backend2-anta details | ||
| accountName = try XCTUnwrap(accountPage.getAccountName()) | ||
| domanInfo = try XCTUnwrap(accountPage.getDomainInfo()) | ||
| XCTAssertEqual(accountName, user_Backend2.name, "Account name didn't match \(user_Backend2.name)") | ||
| XCTAssertTrue( | ||
| accountPage.getUsername().contains(user_Backend2.username), | ||
| "Username didn't contain \(user_Backend2.username)" | ||
| ) | ||
| XCTAssertEqual(accountPage.getEmail(), user_Backend2.email, "Email didn't contain \(user_Backend2.email)") | ||
| XCTAssertEqual(domanInfo, domainInfoAnta, "Domain info \(domanInfo) mismatched on account page") | ||
|
|
||
| accountPage = try accountPage.backToSettings() | ||
| .switchToConversationsTab() | ||
| .openUserAccountPageForUser(with: user_Backend2.name) | ||
| .switchUserAccountForUser(withName: user_Backend1.name) | ||
| .openSettings() | ||
| .openAccountSettings() | ||
|
|
||
| // Verify backend1-staging details - after switching account | ||
| accountName = try XCTUnwrap(accountPage.getAccountName()) | ||
| domanInfo = try XCTUnwrap(accountPage.getDomainInfo()) | ||
| XCTAssertEqual(accountName, user_Backend1.name, "Account name didn't match \(user_Backend1.name)") | ||
| XCTAssertTrue( | ||
| accountPage.getUsername().contains(user_Backend1.username), | ||
| "Username didn't contain \(user_Backend1.username)" | ||
| ) | ||
| XCTAssertEqual(accountPage.getEmail(), user_Backend1.email, "Email didn't contain \(user_Backend1.email)") | ||
| XCTAssertEqual(domanInfo, domainInfoStaging, "Domain info \(domanInfo) mismatched on account page") | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.