forked from enviPath/enviPy
Current Dev State
This commit is contained in:
36
static/js/ketcher2/node_modules/webdriverio/lib/commands/setOrientation.js
generated
vendored
Normal file
36
static/js/ketcher2/node_modules/webdriverio/lib/commands/setOrientation.js
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
/**
|
||||
*
|
||||
* Set a device orientation.
|
||||
*
|
||||
* <example>
|
||||
:setOrientation.js
|
||||
it('should set a geo location for the device', function () {
|
||||
browser.setOrientation('landscape');
|
||||
|
||||
var orientation = browser.getOrientation();
|
||||
console.log(orientation); // outputs: "landscape"
|
||||
});
|
||||
* </example>
|
||||
*
|
||||
* @alias browser.setOrientation
|
||||
* @param {String} orientation the new browser orientation (`landscape/portrait`)
|
||||
* @uses protocol/orientation
|
||||
* @type mobile
|
||||
* @for android, ios
|
||||
*
|
||||
*/
|
||||
|
||||
import { CommandError } from '../utils/ErrorHandler'
|
||||
|
||||
let setOrientation = function (orientation) {
|
||||
/*!
|
||||
* parameter check
|
||||
*/
|
||||
if (typeof orientation !== 'string') {
|
||||
throw new CommandError('number or type of arguments don\'t agree with setOrientation command')
|
||||
}
|
||||
|
||||
return this.orientation(orientation.toUpperCase())
|
||||
}
|
||||
|
||||
export default setOrientation
|
||||
Reference in New Issue
Block a user