<commit_before>/* 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 Foundation
import XCTest

class BasicBrowsing: BaseTestCase {

    // Smoke test
    func testLaunchExternalApp() {
        // Load URL
        loadWebPage("https://www.example.com")
        waitForWebPageLoad()

        // Tap on Page Action button
        waitforExistence(element: app.buttons["URLBar.pageActionsButton"])
        app.buttons["URLBar.pageActionsButton"].tap()

        // Tap Share button
        let ShareButton = app.cells["Share Page With..."]
        waitforExistence(element: ShareButton)
        ShareButton.tap()

        // Launch external app
        let RemindersApp = app.cells["Reminders"]
        waitforExistence(element: RemindersApp)
        RemindersApp.tap()
        waitforExistence(element: app.buttons["Add"])
        XCTAssertTrue(app.buttons["Add"].exists)
    }
    
    // Smoke test
    func testAdBlocking() {
        // Load URL
        loadWebPage("https://blockads.fivefilters.org/")
        waitForWebPageLoad()

        // Check ad blocking is enabled
        let TrackingProtection = app.staticTexts["Ad blocking enabled!"]
        XCTAssertTrue(TrackingProtection.exists)
    }

    // Smoketest
    func testNavigationToolbar() {
        loadWebPage("example.com")
        waitForWebPageLoad()
        loadWebPage("mozilla.org")
        waitForWebPageLoad()

        // Tap Reload button
        app.buttons["BrowserToolset.stopReloadButton"].tap()<commit_msg>For #1894 - Disable XCUI AdBlocking test<commit_after>/* 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 Foundation
import XCTest

class BasicBrowsing: BaseTestCase {

    // Smoke test
    func testLaunchExternalApp() {
        // Load URL
        loadWebPage("https://www.example.com")
        waitForWebPageLoad()

        // Tap on Page Action button
        waitforExistence(element: app.buttons["URLBar.pageActionsButton"])
        app.buttons["URLBar.pageActionsButton"].tap()

        // Tap Share button
        let ShareButton = app.cells["Share Page With..."]
        waitforExistence(element: ShareButton)
        ShareButton.tap()

        // Launch external app
        let RemindersApp = app.cells["Reminders"]
        waitforExistence(element: RemindersApp)
        RemindersApp.tap()
        waitforExistence(element: app.buttons["Add"])
        XCTAssertTrue(app.buttons["Add"].exists)
    }
    
    // Smoke test
    /* Disabled due to issue 1894
    func testAdBlocking() {
        // Load URL
        loadWebPage("https://blockads.fivefilters.org/")
        waitForWebPageLoad()

        // Check ad blocking is enabled
        let TrackingProtection = app.staticTexts["Ad blocking enabled!"]
        XCTAssertTrue(TrackingProtection.exists)
    }
    */

    // Smoketest
    func testNavigationToolbar() {
        loadWebPage("example.com")
        waitForWebPageLoad()
        loadWebPage("mozilla.org")
        waitForWebPageLoad()

        // Tap Reload button
        app.buttons["BrowserToolset.stopReloadButton"].tap()
{'fraction_non_alphanumeric': 0.10507462686567164, 'fraction_numerical': 0.004776119402985075, 'mean_word_length': 2.494264859228363, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3801106', 'n_tokens_mistral': 988, 'n_tokens_neox': 937, 'n_words': 231}