Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Protractor - Return the operating system

Does anyone know how to return the operating system using Protractor?

A little context: I need to press some keys (I think I'll be using action sequence to do so) but as the keyboard is different for MAC and PC, I think I need an if statement detecting which OS I'm running the tests on. If anyone knows a better way to do this? It's further compounded by the keys being relatively unusual (fn + F10) on MAC and just F10 on PC.

Any help much appreciated!

like image 596
madz Avatar asked Aug 27 '14 10:08

madz


People also ask

How to install protractor on Windows 10?

Step 1) Open command prompt and type “npm install –g protractor” and hit Enter. The above command will download the necessary files and install Protractor on the client system. Step 2) Check the installation and version using “Protractor –version.”

What is the return promise in protractor?

For example Promise<boolean> stands for return is a promise which will be resolved to boolean. Since almost all tests involve protractor browser commands like launch, shutdown, navigation, etc. the test should contain the import browser statement which can be done as below:

What is protractor?

What is Protractor? Schedule, educate, inspect, estimate, remind and monitor all aspects of your automotive shop operation from one, easy-to-use cloud based solution. The result of our philosophy is Protractor.NET, a shop management platform that powers all aspects of the automotive shop.

What is the use of restart () function in protractorbrowser?

Purpose: The restart () function in ProtractorBrowser class is used to restart the browser instance. Returns: This command returns the promise which will be resolved to ProtractorBrowser type. All cookies and browser settings will be cleared since it restarts with a fresh instance of the browser.


1 Answers

Protractor runs on node, so you can use the inbuilt node variable process.platform.

like image 131
Ed_ Avatar answered Oct 03 '22 10:10

Ed_