diff --git a/tests/e2e/runners/firefox/firefox.e2e.runner.js b/tests/e2e/runners/firefox/firefox.e2e.runner.js index 4b7721fa3..5b830984b 100644 --- a/tests/e2e/runners/firefox/firefox.e2e.runner.js +++ b/tests/e2e/runners/firefox/firefox.e2e.runner.js @@ -24,11 +24,11 @@ async function loadFirefoxDriver () { return driver; }; -// Preserve the order of loading, because when a user runs these on local machine, the second driver will be on top of and cover the first one -// so we need to use the second one first +// Preserve the order of loading, because when a user runs these on local machine, the third driver will be on top of and cover the first one +// so we need to use the third one first +const driver_for_tonedear = await loadFirefoxDriver(); const driver_for_gutenberg = await loadFirefoxDriver(); const driver_for_ray_charles = await loadFirefoxDriver(); -const driver_for_tonedear = await loadFirefoxDriver(); await legacyRayCharles.runTests(driver_for_ray_charles); await gutenbergRo.runTests(driver_for_gutenberg); diff --git a/tests/e2e/spec/tonedear.e2e.spec.js b/tests/e2e/spec/tonedear.e2e.spec.js index 11497f42c..486496268 100644 --- a/tests/e2e/spec/tonedear.e2e.spec.js +++ b/tests/e2e/spec/tonedear.e2e.spec.js @@ -104,6 +104,37 @@ function runTests (driver, modes) { } }); + it('Navigate to "Android & iOS App"', async function () { + if (!serviceWorkerAPI) { + console.log('\x1b[33m%s\x1b[0m', ' - Following test skipped:'); + this.skip(); + } + + // Switch to iframe if necessary (adjust based on your app's structure) + await driver.switchTo().frame('articleContent'); // Adjust this if your app uses a different iframe + + // Wait until the index has loaded + await driver.wait(async function () { + const contentAvailable = await driver.executeScript('return document.getElementById("mw-content-text");'); + return contentAvailable; + }, 20000); + + // Locate the Android & iOS App link using a specific XPath + const appLink = await driver.wait(until.elementLocated(By.xpath("//ul[contains(@class, 'navbar-nav navbar-right')]/li[1]/a")), 20000); // Adjusted XPath + + // Ensure it's visible before clicking + await driver.wait(until.elementIsVisible(appLink), 20000); + + // Click the link to navigate + await appLink.click(); + + // Optionally, wait for a moment to allow navigation to complete + await driver.sleep(1000); + + // Switch back to default content if needed + await driver.switchTo().defaultContent(); + }); + it('Verify Android and iOS store images in ' + (mode === 'jquery' ? 'Restricted' : 'ServiceWorker') + ' mode', async function () { if (!serviceWorkerAPI && mode === 'jquery') { // Restricted mode test for data URIs