const {seleniumWD} = require('promod');
const {browser} = seleniumWD
browser.Key // getter - returns keyboard keys
const {seleniumWD} = require('promod');
const {browser} = seleniumWD
browser.baseUrl = 'https://your.app.com' // setter
const currnetBaseUrl = browser.baseUrl // getter - returns current base url
await browser.get('/test') // browser will open https://your.app.com/test
const {seleniumWD} = require('promod');
const {browser} = seleniumWD
const url = await browser.getCurrentUrl() // current browser line url
const {seleniumWD} = require('promod');
const {browser} = seleniumWD
const screen = await browser.takeScreenshot()
const {seleniumWD} = require('promod');
const {browser} = seleniumWD
await browser.refresh() // refresh page
const {seleniumWD} = require('promod');
const {browser} = seleniumWD
const tabs = await browser.getTabs() // current browser opened tabs
const {seleniumWD} = require('promod');
const {browser} = seleniumWD
await browser.get('https://www.npmjs.com/package/promod') // open https://www.npmjs.com/package/promod
const {seleniumWD} = require('promod');
const {browser} = seleniumWD
await browser.setWindowSize(200, 600) // set window size to width 200, height 600
const {seleniumWD} = require('promod');
const {browser} = seleniumWD
await browser.sleep(2500) // sleep 2.5 seconds
const {seleniumWD} = require('promod');
const {browser} = seleniumWD
await browser.executeScript(() => document.querySelector('a').innerText) // returns result of the script
const {seleniumWD} = require('promod');
const {browser} = seleniumWD
await browser.executeAsyncScript((done) => {
setTimeout(() => {
done(document.querySelector('a').innerText)
}, 2500)
}) // returns result of the async script
const {seleniumWD} = require('promod');
const {browser} = seleniumWD
await browser.quit() // close session
const {seleniumWD} = require('promod');
const {browser} = seleniumWD
const actionsObj = browser.actions() // returns selenium actions interface
const {seleniumWD} = require('promod');
const {browser} = seleniumWD
const switchToObj = browser.switchTo() // returns selenium switchTo interface
const {seleniumWD} = require('promod');
const {browser} = seleniumWD
const navigateToObj = browser.navigate() // returns selenium navigate interface
const {seleniumWD} = require('promod');
const {browser} = seleniumWD
const CurrentTabObj = await browser.getCurrentTab() // returns current browser tab item
const {seleniumWD} = require('promod');
const {browser} = seleniumWD
await browser.close() // close current browser tab (if one close window)
const {seleniumWD} = require('promod');
const {browser} = seleniumWD
const browserWindowTabTitle = await browser.getTitle();
const {seleniumWD} = require('promod');
const {browser} = seleniumWD
await browser.switchToTab({index: 2}); // will switch context to third browser tab (second tab in tabs array)
await browser.switchToTab({title: 'Some title'}); // will switch context to browser tab where tab title equals 'Some title'
const {seleniumWD} = require('promod');
const {browser} = seleniumWD
await browser.switchToTab({index: 2}); // will switch context to third browser tab (second tab in tabs array)
await browser.returnToInitialTab(); // will switch first opened tab and close all other tabs
const {seleniumWD} = require('promod');
const {browser} = seleniumWD
await browser.runNewBrowser(); // will runNewBrowser new browser
const {seleniumWD} = require('promod');
const {browser} = seleniumWD
await browser.switchToBrowser({index: 0}); // will switch to browser (not tab) which was started first
await browser.switchToBrowser({title: 'Simple-Automation-Testing/promod: Library for browser manipulation'});
// will switch to browser (not tab) which has "Simple-Automation-Testing/promod: Library for browser manipulation" title