A helper library to safely operate Selenium automation
yarn add zafe
import { Builder } from "selenium-webdriver";
const driver = await new Builder()
.forBrowser("chrome")
.build();
const zafe = new Zafe(driver);
await driver.get(`https://www.example.com`);
await zafe.type(By.xpath(`//input[@name="id"]`), `user001`);
await zafe.click(By.xpath(`//*[contains(text(), "Login")]`));
const options = {
shouldLogTraces: true,
shouldCaptureOnSuccess: false,
screenCaptureFolder: "./output/screenshots",
shouldLogTraces: true
}
const zafe = new Zafe(driver, options);