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 test can remove data #1980

Merged
merged 1 commit into from
Dec 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions SyncE2EUITests/CriticalPathsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,46 @@ final class CriticalPathsTests: XCTestCase {
XCTAssertTrue(beginSync.exists, "Begyn Sync text is not visible")
}

func testCanRemoveData() {
// Go to Sync Set up
let newTabWindow = app.windows["New Tab"]
newTabWindow.children(matching: .button).element(boundBy: 4).click()
newTabWindow.menuItems["openPreferences:"].click()
let settingsWindow = app.windows["Settings"]
settingsWindow.buttons["Sync & Backup"].click()

// Create Account
let sheetsQuery = settingsWindow.sheets
settingsWindow.staticTexts["Sync and Back Up This Device"].click()
sheetsQuery.buttons["Turn on Sync & Backup"].click()
sheetsQuery.buttons["Copy Code"].click()
sheetsQuery.buttons["Next"].click()
sheetsQuery.buttons["Done"].click()
let syncEnabledElement = settingsWindow.staticTexts["Sync Enabled"]
XCTAssertTrue(syncEnabledElement.exists, "Sync Enabled text is not visible")

// Delete Data
settingsWindow.swipeUp()
settingsWindow.buttons["Turn Off and Delete Server Data"].click()
sheetsQuery.buttons["Delete Data"].click()
let beginSync = settingsWindow.staticTexts["Begin Syncing"]
beginSync.click()
XCTAssertTrue(beginSync.exists, "Begyn Sync text is not visible")

// Log In and check error
settingsWindow.staticTexts["Sync with Another Device"].click()
let settingsSheetsQuery = settingsWindow.sheets
settingsSheetsQuery.staticTexts["Enter Code"].click()
settingsSheetsQuery.buttons["Paste"].click()
let alertSheet = sheetsQuery.sheets["alert"]
alertSheet.staticTexts["Sync Error"].click()
XCTAssertTrue(alertSheet.exists, "Sync Error text is not visible")

// Clean Up
debugMenuBarItem.click()
internaluserstateMenuItem.click()
}

func testCanLoginToExistingSyncAccount() {
guard let code = ProcessInfo.processInfo.environment["CODE"] else {
XCTFail("CODE not set")
Expand Down
Loading