-
Notifications
You must be signed in to change notification settings - Fork 27k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mocha_test.js - update to modern syntax (#697)
This is a companion change to mdn/content#31050
- Loading branch information
1 parent
558306e
commit 6b96087
Showing
1 changed file
with
20 additions
and
19 deletions.
There are no files selected for viewing
39 changes: 20 additions & 19 deletions
39
tools-testing/cross-browser-testing/selenium/mocha_test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,26 @@ | ||
'use strict'; | ||
"use strict"; | ||
|
||
const assert = require('assert'); | ||
const assert = require("assert"); | ||
|
||
let webdriver = require('selenium-webdriver'), | ||
By = webdriver.By, | ||
until = webdriver.until; | ||
const { Builder, Capabilities, By } = require("selenium-webdriver"); | ||
|
||
describe('Alert', () => { | ||
it('should have the correct text content - this is from the first button', done => { | ||
let driver = new webdriver.Builder() | ||
.withCapabilities(webdriver.Capabilities.firefox()) | ||
.build(); | ||
describe("Alert", () => { | ||
it("should have the correct text content - this is from the first button", (done) => { | ||
let driver = new Builder() | ||
.withCapabilities(Capabilities.firefox()) | ||
.build(); | ||
|
||
driver.get('http://mdn.github.io/learning-area/tools-testing/cross-browser-testing/accessibility/native-keyboard-accessibility.html') | ||
.then(() => driver.findElement(By.css('button:nth-of-type(1)'))) | ||
.then(button => button.click()) | ||
.then(() => driver.switchTo().alert()) | ||
.then(alert => alert.getText()) | ||
.then(text => assert.equal(text, 'This is from the first button')) | ||
.then(() => driver.quit()) | ||
.then(done) | ||
.catch(err => done(err)); | ||
driver | ||
.get( | ||
"http://mdn.github.io/learning-area/tools-testing/cross-browser-testing/accessibility/native-keyboard-accessibility.html" | ||
) | ||
.then(() => driver.findElement(By.css("button:nth-of-type(1)"))) | ||
.then((button) => button.click()) | ||
.then(() => driver.switchTo().alert()) | ||
.then((alert) => alert.getText()) | ||
.then((text) => assert.equal(text, "This is from the first button")) | ||
.then(() => driver.quit()) | ||
.then(done) | ||
.catch((err) => done(err)); | ||
}); | ||
}); |