@applitools/eyes
Version:
52 lines (51 loc) • 1.5 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.AndroidDeviceTarget = void 0;
const ScreenOrientation_1 = require("../enums/ScreenOrientation");
/**
* Represents an Android device target with optional orientation configuration.
* This class provides a fluent API for specifying device orientation.
*/
class AndroidDeviceTarget {
constructor(deviceName) {
this.deviceName = deviceName;
}
/**
* Sets the device orientation to landscape.
* @returns this instance for method chaining
*/
landscape() {
this.screenOrientation = ScreenOrientation_1.ScreenOrientationEnum.LANDSCAPE;
return this;
}
/**
* Sets the device orientation to portrait.
* @returns this instance for method chaining
*/
portrait() {
this.screenOrientation = ScreenOrientation_1.ScreenOrientationEnum.PORTRAIT;
return this;
}
/**
* Gets the configured orientation for this device target.
* @returns the screen orientation, or undefined if not set
*/
getOrientation() {
return this.screenOrientation;
}
/**
* Gets the device name.
* @returns the device name string
*/
getDeviceName() {
return this.deviceName;
}
/**
* String representation of this device target.
* @returns the device name
*/
toString() {
return this.deviceName;
}
}
exports.AndroidDeviceTarget = AndroidDeviceTarget;