diff --git a/Client.xcodeproj/project.pbxproj b/Client.xcodeproj/project.pbxproj index 0d08e5c6a742..c3c2620c1cd4 100644 --- a/Client.xcodeproj/project.pbxproj +++ b/Client.xcodeproj/project.pbxproj @@ -186,7 +186,7 @@ 2C2A91291FA2410D002E36BD /* HistoryTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C2A91281FA2410D002E36BD /* HistoryTests.swift */; }; 2C31A7A91E8BFB2200DAC646 /* ReadingListTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C31A7A81E8BFB2200DAC646 /* ReadingListTests.swift */; }; 2C31A8471E8D447F00DAC646 /* HomePageSettingsUITest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C31A8461E8D447F00DAC646 /* HomePageSettingsUITest.swift */; }; - 2C3406C81E719F00000FD889 /* SettingsTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C3406C71E719F00000FD889 /* SettingsTest.swift */; }; + 2C3406C81E719F00000FD889 /* SettingsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C3406C71E719F00000FD889 /* SettingsTests.swift */; }; 2C473BD0209778900008C853 /* DownloadsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C473BCF209778900008C853 /* DownloadsTests.swift */; }; 2C49854E206173C800893DAE /* photon-colors.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C49854D206173C800893DAE /* photon-colors.swift */; }; 2C4A07DC20246EAD0083E320 /* DragAndDropTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C4A07DB20246EAD0083E320 /* DragAndDropTests.swift */; }; @@ -275,7 +275,6 @@ 3BF4B8E91D38497A00493393 /* BaseTestCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3BF4B8E81D38497A00493393 /* BaseTestCase.swift */; }; 3BF56D271CDBBE1F00AC4D75 /* SimpleToast.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3BF56D261CDBBE1F00AC4D75 /* SimpleToast.swift */; }; 3BFE4B501D34673D00DDF53F /* ThirdPartySearchTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3BFE4B4F1D34673D00DDF53F /* ThirdPartySearchTest.swift */; }; - 3D71C89E1F5703A1008D8646 /* CopiedLinksTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D71C89D1F5703A1008D8646 /* CopiedLinksTests.swift */; }; 3D9CA9841EF456A8002434DD /* NightModeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D9CA9831EF456A8002434DD /* NightModeTests.swift */; }; 3D9CA9A81EF84D04002434DD /* NoImageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D9CA9A71EF84D04002434DD /* NoImageTests.swift */; }; 3D9CAA1C1EFCD655002434DD /* ClipBoardTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D9CAA1B1EFCD655002434DD /* ClipBoardTests.swift */; }; @@ -2315,7 +2314,7 @@ 2C31A7A81E8BFB2200DAC646 /* ReadingListTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReadingListTests.swift; sourceTree = ""; }; 2C31A8461E8D447F00DAC646 /* HomePageSettingsUITest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HomePageSettingsUITest.swift; sourceTree = ""; }; 2C33410CB7E921A125379D7C /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = ""; }; - 2C3406C71E719F00000FD889 /* SettingsTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingsTest.swift; sourceTree = ""; }; + 2C3406C71E719F00000FD889 /* SettingsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingsTests.swift; sourceTree = ""; }; 2C473BCF209778900008C853 /* DownloadsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DownloadsTests.swift; sourceTree = ""; }; 2C49854D206173C800893DAE /* photon-colors.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "photon-colors.swift"; sourceTree = ""; }; 2C4A07DB20246EAD0083E320 /* DragAndDropTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DragAndDropTests.swift; sourceTree = ""; }; @@ -2534,7 +2533,6 @@ 3D1B427CBBF9661428718235 /* ast */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ast; path = ast.lproj/AuthenticationManager.strings; sourceTree = ""; }; 3D254A72992C6FE06123E4F1 /* is */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = is; path = is.lproj/Search.strings; sourceTree = ""; }; 3D3A4AE2A54D99CE5F25E57E /* sat-Olck */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "sat-Olck"; path = "sat-Olck.lproj/ClearPrivateData.strings"; sourceTree = ""; }; - 3D71C89D1F5703A1008D8646 /* CopiedLinksTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CopiedLinksTests.swift; sourceTree = ""; }; 3D744D81B8C64FA197FBFC3C /* or */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = or; path = or.lproj/ClearHistoryConfirm.strings; sourceTree = ""; }; 3D844CB6B34780D0E010713A /* ia */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ia; path = "ia.lproj/Default Browser.strings"; sourceTree = ""; }; 3D9CA9831EF456A8002434DD /* NightModeTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NightModeTests.swift; sourceTree = ""; }; @@ -7815,7 +7813,6 @@ 0B305E1A1E3A98A900BE0767 /* BookmarksTests.swift */, 2CF9D9A920067FA10083DF2A /* BrowsingPDFTests.swift */, 3D9CAA1B1EFCD655002434DD /* ClipBoardTests.swift */, - 3D71C89D1F5703A1008D8646 /* CopiedLinksTests.swift */, EB3A38912032673D004C6E67 /* DatabaseFixtureTest.swift */, 2CC1B3EF1E9B861400814EEC /* DomainAutocompleteTests.swift */, 2C473BCF209778900008C853 /* DownloadsTests.swift */, @@ -7842,7 +7839,7 @@ 39012F271F8ED262002E3D31 /* ScreenGraphTest.swift */, 2CEA6F781E93E3A600D4100E /* SearchSettingsUITest.swift */, 2CA16FDD1E5F089100332277 /* SearchTest.swift */, - 2C3406C71E719F00000FD889 /* SettingsTest.swift */, + 2C3406C71E719F00000FD889 /* SettingsTests.swift */, 0BC9C9C31F26F54D000E8AB5 /* SiteLoadTest.swift */, 2CEDADA120207EC400223A89 /* SyncFAUITests.swift */, 3BFE4B4F1D34673D00DDF53F /* ThirdPartySearchTest.swift */, @@ -12278,7 +12275,6 @@ 2C4A07DC20246EAD0083E320 /* DragAndDropTests.swift in Sources */, 2C2A5EF41E68469500F02659 /* PrivateBrowsingTest.swift in Sources */, D4C35391283500A600F7DC7D /* PerformanceTests.swift in Sources */, - 3D71C89E1F5703A1008D8646 /* CopiedLinksTests.swift in Sources */, 2CF449A51E7BFE2C00FD7595 /* NavigationTest.swift in Sources */, 2C2A91291FA2410D002E36BD /* HistoryTests.swift in Sources */, 782B0A362AB41DFC0049EE1A /* FakespotTests.swift in Sources */, @@ -12310,7 +12306,7 @@ 2C8C07771E7800EA00DC1237 /* FindInPageTests.swift in Sources */, 2CB56E3F1E926BFB00AF7586 /* ToolbarTest.swift in Sources */, B10997432A97251D00CC8860 /* UrlBarTests.swift in Sources */, - 2C3406C81E719F00000FD889 /* SettingsTest.swift in Sources */, + 2C3406C81E719F00000FD889 /* SettingsTests.swift in Sources */, 2CF21D0920A4A163000D08B7 /* PocketTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/Tests/ExperimentIntegrationTests.xctestplan b/Tests/ExperimentIntegrationTests.xctestplan index ba2f2bea74fb..a90e943a2de2 100644 --- a/Tests/ExperimentIntegrationTests.xctestplan +++ b/Tests/ExperimentIntegrationTests.xctestplan @@ -20,7 +20,6 @@ "BookmarksTests", "BrowsingPDFTests", "ClipBoardTests", - "CopiedLinksTests", "DataManagementTests", "DatabaseFixtureTest", "DesktopModeTestsIpad", @@ -59,7 +58,7 @@ "ScreenGraphTest", "SearchSettingsUITests", "SearchTests", - "SettingsTest", + "SettingsTests", "SiteLoadTest", "SyncUITests", "TabCounterTests", diff --git a/Tests/PerformanceTestPlan.xctestplan b/Tests/PerformanceTestPlan.xctestplan index 03f3ecd6552e..522b4dcba7aa 100644 --- a/Tests/PerformanceTestPlan.xctestplan +++ b/Tests/PerformanceTestPlan.xctestplan @@ -19,7 +19,6 @@ "BookmarksTests", "BrowsingPDFTests", "ClipBoardTests", - "CopiedLinksTests", "DataManagementTests", "DatabaseFixtureTest", "DatabaseFixtureTest\/testPerfBookmarks1000openMenu()", @@ -65,7 +64,7 @@ "ScreenGraphTest", "SearchSettingsUITests", "SearchTests", - "SettingsTest", + "SettingsTests", "SiteLoadTest", "SyncUITests", "TabCounterTests", diff --git a/Tests/SmokeXCUITests.xctestplan b/Tests/SmokeXCUITests.xctestplan index 84252c6b420f..349430c4aae0 100644 --- a/Tests/SmokeXCUITests.xctestplan +++ b/Tests/SmokeXCUITests.xctestplan @@ -52,7 +52,6 @@ "BookmarksTests\/testRecentlyBookmarked()", "BrowsingPDFTests", "ClipBoardTests\/testClipboard()", - "CopiedLinksTests", "CronTabsPerformanceTest", "DataManagementTests\/testWebSiteDataOptions()", "DatabaseFixtureTest", @@ -161,7 +160,7 @@ "SearchTests\/testPromptPresence()", "SearchTests\/testSearchIconOnAboutHome()", "SearchTests\/testSearchWithFirefoxOption()", - "SettingsTest", + "SettingsTests", "SiteLoadTest", "SyncUITests", "SyncUITests\/testCreateAnAccountLink()", diff --git a/Tests/Smoketest2.xctestplan b/Tests/Smoketest2.xctestplan index 044f99c1b7a9..31e0718888b1 100644 --- a/Tests/Smoketest2.xctestplan +++ b/Tests/Smoketest2.xctestplan @@ -23,7 +23,6 @@ "BrowsingPDFTests\/testLongPressOnPDFLinkToAddToReadingList()", "BrowsingPDFTests\/testOpenPDFViewer()", "ClipBoardTests", - "CopiedLinksTests", "CronTabsPerformanceTest", "DataManagementTests", "DatabaseFixtureTest", @@ -78,7 +77,7 @@ "SearchTests\/testPromptPresence()", "SearchTests\/testSearchIconOnAboutHome()", "SearchTests\/testSearchWithFirefoxOption()", - "SettingsTest", + "SettingsTests", "SiteLoadTest", "SyncUITests", "TabCounterTests", diff --git a/Tests/Smoketest3.xctestplan b/Tests/Smoketest3.xctestplan index 3553f48a7b0b..93ec38e46585 100644 --- a/Tests/Smoketest3.xctestplan +++ b/Tests/Smoketest3.xctestplan @@ -21,7 +21,6 @@ "BookmarksTests", "BrowsingPDFTests", "ClipBoardTests", - "CopiedLinksTests", "DataManagementTests", "DatabaseFixtureTest", "DesktopModeTestsIpad", @@ -100,7 +99,7 @@ "ScreenGraphTest", "SearchSettingsUITests", "SearchTests", - "SettingsTest", + "SettingsTests", "SiteLoadTest", "SyncUITests", "TabCounterTests", diff --git a/Tests/Smoketest4.xctestplan b/Tests/Smoketest4.xctestplan index 580e13ac0cd5..dea75158506e 100644 --- a/Tests/Smoketest4.xctestplan +++ b/Tests/Smoketest4.xctestplan @@ -21,7 +21,6 @@ "BookmarksTests", "BrowsingPDFTests", "ClipBoardTests", - "CopiedLinksTests", "DataManagementTests", "DatabaseFixtureTest", "DesktopModeTestsIpad", @@ -104,7 +103,7 @@ "SearchTests\/testPromptPresence()", "SearchTests\/testSearchIconOnAboutHome()", "SearchTests\/testSearchWithFirefoxOption()", - "SettingsTest", + "SettingsTests", "SiteLoadTest", "SyncUITests", "TabCounterTests", diff --git a/Tests/SyncIntegrationTestPlan.xctestplan b/Tests/SyncIntegrationTestPlan.xctestplan index 53d3811c151b..c71df13b0018 100644 --- a/Tests/SyncIntegrationTestPlan.xctestplan +++ b/Tests/SyncIntegrationTestPlan.xctestplan @@ -43,7 +43,6 @@ "BookmarksTests", "BrowsingPDFTests", "ClipBoardTests", - "CopiedLinksTests", "CronTabsPerformanceTest", "DataManagementTests", "DatabaseFixtureTest", @@ -85,7 +84,7 @@ "ScreenGraphTest", "SearchSettingsUITests", "SearchTests", - "SettingsTest", + "SettingsTests", "SiteLoadTest", "SyncUITests", "TabCounterTests", diff --git a/Tests/XCUITests/SettingsTest.swift b/Tests/XCUITests/DefaultBrowserTests.swift similarity index 64% rename from Tests/XCUITests/SettingsTest.swift rename to Tests/XCUITests/DefaultBrowserTests.swift index dc07588d7742..527f6f216570 100644 --- a/Tests/XCUITests/SettingsTest.swift +++ b/Tests/XCUITests/DefaultBrowserTests.swift @@ -2,37 +2,12 @@ // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/ -import XCTest +import Foundation -class SettingsTest: BaseTestCase { - func testHelpOpensSUMOInTab() { - navigator.nowAt(NewTabScreen) - navigator.goto(SettingsScreen) - let settingsTableView = app.tables[AccessibilityIdentifiers.Settings.tableViewController] - - while settingsTableView.staticTexts["Help"].exists == false { - settingsTableView.swipeUp() - } - let helpMenu = settingsTableView.cells["Help"] - XCTAssertTrue(helpMenu.isEnabled) - helpMenu.tap() - - waitUntilPageLoad() - mozWaitForValueContains(app.textFields["url"], value: "support.mozilla.org") - mozWaitForElementToExist(app.webViews.staticTexts["Firefox for iOS Support"]) - - let numTabs = app.buttons["Show Tabs"].value - XCTAssertEqual("2", numTabs as? String, "Sume should be open in a different tab") - } - - func testOpenSiriOption() { - waitForTabsButton() - navigator.nowAt(NewTabScreen) - navigator.performAction(Action.OpenSiriFromSettings) - mozWaitForElementToExist(app.cells["SiriSettings"], timeout: 5) - } +class DefaultBrowserTests: BaseTestCase { + // https://testrail.stage.mozaws.net/index.php?/cases/view/2306804 /* Disable test since the option to set Firefox is not available in this build after issue #8513 landed, issue #8627 - func testDefaultBrowser() { + func testSetFirefoxDefaultBrowserFromHomeScreenBanner() { // A default browser card should be available on the home screen mozWaitForElementToExist(app.staticTexts["Set links from websites, emails, and Messages to open automatically in Firefox."], timeout: 5) mozWaitForElementToExist(app.buttons["Learn More"], timeout: 5) diff --git a/Tests/XCUITests/SettingsTests.swift b/Tests/XCUITests/SettingsTests.swift new file mode 100644 index 000000000000..c3070b1d3699 --- /dev/null +++ b/Tests/XCUITests/SettingsTests.swift @@ -0,0 +1,63 @@ +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this +// file, You can obtain one at http://mozilla.org/MPL/2.0/ + +import XCTest + +class SettingsTests: BaseTestCase { + // https://testrail.stage.mozaws.net/index.php?/cases/view/2334757 + func testHelpOpensSUMOInTab() { + navigator.nowAt(NewTabScreen) + navigator.goto(SettingsScreen) + let settingsTableView = app.tables[AccessibilityIdentifiers.Settings.tableViewController] + + while settingsTableView.staticTexts["Help"].exists == false { + settingsTableView.swipeUp() + } + let helpMenu = settingsTableView.cells["Help"] + XCTAssertTrue(helpMenu.isEnabled) + helpMenu.tap() + + waitUntilPageLoad() + mozWaitForValueContains(app.textFields["url"], value: "support.mozilla.org") + mozWaitForElementToExist(app.webViews.staticTexts["Firefox for iOS Support"]) + + let numTabs = app.buttons["Show Tabs"].value + XCTAssertEqual("2", numTabs as? String, "Sume should be open in a different tab") + } + + // https://testrail.stage.mozaws.net/index.php?/cases/view/2334760 + func testOpenSiriOption() { + waitForTabsButton() + navigator.nowAt(NewTabScreen) + navigator.performAction(Action.OpenSiriFromSettings) + mozWaitForElementToExist(app.cells["SiriSettings"], timeout: 5) + } + + // https://testrail.stage.mozaws.net/index.php?/cases/view/2334756 + func testCopiedLinks() { + navigator.nowAt(NewTabScreen) + navigator.goto(SettingsScreen) + + // Check Offer to open copied links, when opening firefox is off + let value = app.tables.cells.switches["Offer to Open Copied Links, When Opening Firefox"].value + XCTAssertEqual(value as? String, "0") + + // Switch on, Offer to open copied links, when opening firefox + app.tables.cells.switches["Offer to Open Copied Links, When Opening Firefox"].tap() + + // Check Offer to open copied links, when opening firefox is on + let value2 = app.tables.cells.switches["Offer to Open Copied Links, When Opening Firefox"].value + XCTAssertEqual(value2 as? String, "1") + + app.navigationBars["Settings"].buttons["Done"].tap() + + app.buttons[AccessibilityIdentifiers.Toolbar.settingsMenuButton].tap() + let settingsmenuitemCell = app.tables.otherElements["Settings"] + settingsmenuitemCell.tap() + + // Check Offer to open copied links, when opening firefox is on + let value3 = app.tables.cells.switches["Offer to Open Copied Links, When Opening Firefox"].value + XCTAssertEqual(value3 as? String, "1") + } +}