auto-standardize javascript in docs-translations
This commit is contained in:
parent
2e4322c230
commit
4ae6103356
108 changed files with 1213 additions and 1213 deletions
|
@ -72,7 +72,7 @@ $ npm install selenium-webdriver
|
|||
Electronでの `selenium-webdriver` 使用方法は、chrome driverへの接続方法とElectronバイナリがどこにあるかをマニュアルで指定する以外は、upstreamと基本的に同じです。
|
||||
|
||||
```javascript
|
||||
const webdriver = require('selenium-webdriver');
|
||||
const webdriver = require('selenium-webdriver')
|
||||
|
||||
const driver = new webdriver.Builder()
|
||||
// The "9515" is the port opened by chrome driver.
|
||||
|
@ -80,22 +80,22 @@ const driver = new webdriver.Builder()
|
|||
.withCapabilities({
|
||||
chromeOptions: {
|
||||
// Here is the path to your Electron binary.
|
||||
binary: '/Path-to-Your-App.app/Contents/MacOS/Electron',
|
||||
binary: '/Path-to-Your-App.app/Contents/MacOS/Electron'
|
||||
}
|
||||
})
|
||||
.forBrowser('electron')
|
||||
.build();
|
||||
.build()
|
||||
|
||||
driver.get('http://www.google.com');
|
||||
driver.findElement(webdriver.By.name('q')).sendKeys('webdriver');
|
||||
driver.findElement(webdriver.By.name('btnG')).click();
|
||||
driver.wait(function() {
|
||||
return driver.getTitle().then(function(title) {
|
||||
return title === 'webdriver - Google Search';
|
||||
});
|
||||
}, 1000);
|
||||
driver.get('http://www.google.com')
|
||||
driver.findElement(webdriver.By.name('q')).sendKeys('webdriver')
|
||||
driver.findElement(webdriver.By.name('btnG')).click()
|
||||
driver.wait(function () {
|
||||
return driver.getTitle().then(function (title) {
|
||||
return title === 'webdriver - Google Search'
|
||||
})
|
||||
}, 1000)
|
||||
|
||||
driver.quit();
|
||||
driver.quit()
|
||||
```
|
||||
|
||||
## WebdriverIOのセットアップをする
|
||||
|
@ -123,20 +123,20 @@ $ npm install webdriverio
|
|||
### 3. chrome driverに接続する
|
||||
|
||||
```javascript
|
||||
const webdriverio = require('webdriverio');
|
||||
const webdriverio = require('webdriverio')
|
||||
const options = {
|
||||
host: "localhost", // Use localhost as chrome driver server
|
||||
port: 9515, // "9515" is the port opened by chrome driver.
|
||||
desiredCapabilities: {
|
||||
browserName: 'chrome',
|
||||
chromeOptions: {
|
||||
binary: '/Path-to-Your-App/electron', // Path to your Electron binary.
|
||||
args: [/* cli arguments */] // Optional, perhaps 'app=' + /path/to/your/app/
|
||||
}
|
||||
host: 'localhost', // Use localhost as chrome driver server
|
||||
port: 9515, // "9515" is the port opened by chrome driver.
|
||||
desiredCapabilities: {
|
||||
browserName: 'chrome',
|
||||
chromeOptions: {
|
||||
binary: '/Path-to-Your-App/electron', // Path to your Electron binary.
|
||||
args: [/* cli arguments */] // Optional, perhaps 'app=' + /path/to/your/app/
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
let client = webdriverio.remote(options);
|
||||
let client = webdriverio.remote(options)
|
||||
|
||||
client
|
||||
.init()
|
||||
|
@ -144,9 +144,9 @@ client
|
|||
.setValue('#q', 'webdriverio')
|
||||
.click('#btnG')
|
||||
.getTitle().then((title) => {
|
||||
console.log('Title was: ' + title);
|
||||
console.log('Title was: ' + title)
|
||||
})
|
||||
.end();
|
||||
.end()
|
||||
```
|
||||
|
||||
## ワークフロー
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue