Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: test/wrappers/pages.js

Issue 29984574: Noissue - Adapt for test pages changes running circumvention tests (Closed)
Patch Set: Created Jan. 17, 2019, 8:12 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/wrappers/pages.js
===================================================================
--- a/test/wrappers/pages.js
+++ b/test/wrappers/pages.js
@@ -95,20 +95,34 @@
return this.driver.navigate().to(TEST_PAGES_URL).then(() =>
this.driver.findElements(By.css(".site-pagelist a"))
).then(elements =>
- Promise.all(elements.map(elem => elem.getAttribute("href")))
+ Promise.all(elements.map(elem => Promise.all([elem.getAttribute("href"),
+ elem.getText()])))
Sebastian Noack 2019/01/17 08:17:13 Previously, we were getting the page title from th
).then(urls =>
{
let p1 = Promise.resolve();
- for (let url of urls)
+ for (let [url, pageTitle] of urls)
+ {
+ let browser = this.test.parent.title.replace(/\s.*$/, "");
+ if (// https://issues.adblockplus.org/ticket/6917
+ pageTitle == "$subdocument" && browser == "Firefox" ||
+ // Chromium doesn't support Flash
+ pageTitle.startsWith("$object") && browser == "Chromium" ||
+ // Chromium 63 doesn't have user stylesheets (required to
+ // overrule inline styles) and doesn't run content scripts
+ // in dynamically written documents.
+ this.test.parent.title == "Chromium (oldest)" &&
+ (pageTitle == "Inline style !important" ||
+ pageTitle == "Anonymous iframe document.write()"))
+ continue;
+
p1 = p1.then(() =>
this.driver.navigate().to(url)
).then(() =>
Promise.all([
getSections(this.driver),
- this.driver.findElement(By.css("h2")).getAttribute("textContent"),
this.driver.executeScript("document.body.classList.add('expected');")
])
- ).then(([sections, pageTitle]) =>
+ ).then(([sections]) =>
Promise.all(sections.map(([title, demo, filters]) =>
Promise.all([
title.getAttribute("textContent").then(testTitle =>
@@ -124,13 +138,6 @@
for (let i = 0; i < testCases.length; i++)
{
let [title, expectedScreenshot, filters] = testCases[i];
- let browser = this.test.parent.title.replace(/\s.*$/, "");
-
- if (// https://issues.adblockplus.org/ticket/6917
- title == "$subdocument - Test case" && browser == "Firefox" ||
- // Chromium doesn't support Flash
- /^\$object(-subrequest)? /.test(title) && browser == "Chromium")
- continue;
p2 = p2.then(() =>
this.driver.navigate().to(this.origin + "/options.html")
@@ -156,7 +163,7 @@
return this.driver.navigate().to(url);
}).then(() =>
{
- if (title.startsWith("$popup "))
+ if (pageTitle.startsWith("$popup"))
{
return getSections(this.driver).then(sections =>
sections[i][1].findElement(By.css("a[href],button")).click()
@@ -166,7 +173,7 @@
this.driver.getAllWindowHandles()
).then(handles =>
{
- if (title.startsWith("$popup Exception -"))
+ if (pageTitle == "$popup - Exception")
{
assert.equal(handles.length, 3, title);
return closeWindow(this.driver, handles[2], handles[1]);
@@ -197,6 +204,7 @@
}
return p2;
});
+ }
return p1;
});
});
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld