forked from enviPath/enviPy
Current Dev State
This commit is contained in:
35
static/js/ketcher2/node_modules/webdriverio/lib/commands/getOrientation.js
generated
vendored
Normal file
35
static/js/ketcher2/node_modules/webdriverio/lib/commands/getOrientation.js
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
/**
|
||||
*
|
||||
* Get the current browser orientation. This command only works for mobile environments like Android Emulator,
|
||||
* iOS Simulator or on real devices.
|
||||
*
|
||||
* <example>
|
||||
:getOrientation.js
|
||||
it('should get the orientation of my mobile device', function () {
|
||||
var orientation = browser.getOrientation();
|
||||
console.log(orientation); // outputs: "landscape"
|
||||
});
|
||||
* </example>
|
||||
*
|
||||
* @alias browser.getOrientation
|
||||
* @return {String} device orientation (`landscape/portrait`)
|
||||
* @uses protocol/orientation
|
||||
* @for android, ios
|
||||
* @type mobile
|
||||
*
|
||||
*/
|
||||
|
||||
import { CommandError } from '../utils/ErrorHandler'
|
||||
|
||||
let getOrientation = function () {
|
||||
if (!this.isMobile) {
|
||||
throw new CommandError('getOrientation command is not supported on non mobile platforms')
|
||||
}
|
||||
|
||||
return this.unify(this.orientation(), {
|
||||
lowercase: true,
|
||||
extractValue: true
|
||||
})
|
||||
}
|
||||
|
||||
export default getOrientation
|
||||
Reference in New Issue
Block a user