1.3.0 • Published 4 years ago

automark v1.3.0

Weekly downloads
44
License
-
Repository
-
Last release
4 years ago
  • Dependencies If using Chrome, then [https://chromedriver.chromium.org/] must be installed. Otherwise, the browser's driver of your choice must be installed.

  • Browser Support Currently only Chrome and Edge are supported, but adding an additional browser is trivial. The following code adds the Edge browser. Any Edge-specific options can be configured here such as arguments to be passed to the driver.

#+begin_src typescript export class Edge extends Browser { public constructor(options?: BrowserOptions) { super('edge', options); } } #+end_src

  • Usage #+BEGIN_SRC bash npm i --save-dev automark cd automark && npm install #+END_SRC

  • Examples

#+BEGIN_SRC typescript import {should} from "chai"; import {Browser} from "../../src/lib/utils/browsers/browser"; import {Chrome} from "../../src/lib/utils/browsers/chrome"; import {config} from "../../main"; import {FacebookLoginPage} from "../../src/pages/FacebookLoginPage";

describe("Browser Tests", function () { let browser: Browser;

this.timeout(config.timeout);

before(async function () { browser = new Chrome(); should(); });

it.only("Facebook", async function () { const loginPage: FacebookLoginPage = new FacebookLoginPage(browser); await browser.navigate(FacebookLoginPage.URL); await browser.waitUntilPageHasLoaded(FacebookLoginPage); await loginPage.login("username", "pw"); });

after(async () => { await browser.quit(); }); }); #+END_SRC