Skip to content

Commit

Permalink
Move example webextension files to //common/extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
nickgaya committed Jan 4, 2022
1 parent 6e4ffb3 commit 19af9f3
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 28 deletions.
10 changes: 10 additions & 0 deletions common/extensions/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
filegroup(
name = "extensions",
srcs = glob([
"*",
"**/*",
]),
visibility = [
"//javascript/node/selenium-webdriver:__pkg__",
],
)
1 change: 1 addition & 0 deletions javascript/node/selenium-webdriver/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ jasmine_node_test(
data = TEST_DATA + [
"tools/init_jasmine.js",
"//common/src/web",
"//common/extensions",
"@npm//express",
"@npm//multer",
"@npm//serve-index",
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -162,18 +162,18 @@ test.suite(
const dir = await io.tmpDir()
await driver.setDownloadPath(dir)

const url = fileServer.whereIs('/data/firefox/webextension.xpi')
const url = fileServer.whereIs('/data/chrome/download.bin')
await driver.get(`data:text/html,<!DOCTYPE html>
<div><a download="" href="${url}">Go!</a></div>`)

await driver.findElement({ css: 'a' }).click()

const downloadPath = path.join(dir, 'webextension.xpi')
const downloadPath = path.join(dir, 'download.bin')
await driver.wait(() => io.exists(downloadPath), 5000)

const goldenPath = path.join(
__dirname,
'../../lib/test/data/firefox/webextension.xpi'
'../../lib/test/data/chrome/download.bin'
)
assert.strictEqual(
fs.readFileSync(downloadPath, 'binary'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@ const path = require('path')
const chrome = require('../../chrome')
const symbols = require('../../lib/symbols')
const test = require('../../lib/test')
const { locate } = require('../../lib/test/resources')

const WEBEXTENSION_CRX = path.join(
__dirname,
'../../lib/test/data/chrome/webextension.crx'
)
const WEBEXTENSION_CRX = locate(
'common/extensions/webextensions-selenium-example.crx')

describe('chrome.Options', function () {
describe('addArguments', function () {
Expand Down
7 changes: 3 additions & 4 deletions javascript/node/selenium-webdriver/test/edge/options_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@ const path = require('path')
const edge = require('../../edge')
const symbols = require('../../lib/symbols')
const test = require('../../lib/test')
const { locate } = require('../../lib/test/resources')

const WEBEXTENSION_CRX = path.join(
__dirname,
'../../lib/test/data/chrome/webextension.crx'
)
const WEBEXTENSION_CRX = locate(
'common/extensions/webextensions-selenium-example.crx')

describe('edge.Options', function () {
describe('addArguments', function () {
Expand Down
21 changes: 8 additions & 13 deletions javascript/node/selenium-webdriver/test/firefox_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,14 @@ const io = require('../io')
const { Browser } = require('../')
const { Context } = require('../firefox')
const { Pages, suite } = require('../lib/test')

const WEBEXTENSION_EXTENSION_XPI = path.join(
__dirname,
'../lib/test/data/firefox/webextension.xpi'
)
const WEBEXTENSION_EXTENSION_ZIP = path.join(
__dirname,
'../lib/test/data/firefox/webextension.zip'
)
const WEBEXTENSION_EXTENSION_DIR = path.join(
__dirname,
'../lib/test/data/firefox/webextension'
)
const { locate } = require('../lib/test/resources')

const WEBEXTENSION_EXTENSION_XPI = locate(
'common/extensions/webextensions-selenium-example.xpi')
const WEBEXTENSION_EXTENSION_ZIP = locate(
'common/extensions/webextensions-selenium-example.zip')
const WEBEXTENSION_EXTENSION_DIR = locate(
'common/extensions/webextensions-selenium-example')

const WEBEXTENSION_EXTENSION_ID =
'webextensions-selenium-example@example.com.xpi'
Expand Down
7 changes: 3 additions & 4 deletions javascript/node/selenium-webdriver/test/io/zip_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@ const path = require('path')
const io = require('../../io')
const zip = require('../../io/zip')
const { InvalidArgumentError } = require('../../lib/error')
const { locate } = require('../../lib/test/resources')

const XPI_PATH = path.join(
__dirname,
'../../lib/test/data/firefox/webextension.xpi'
)
const XPI_PATH = locate(
'common/extensions/webextensions-selenium-example.xpi')

describe('io/zip', function () {
describe('unzip', function () {
Expand Down

0 comments on commit 19af9f3

Please sign in to comment.