Skip to content

Fast, robust automated testing framework using Page Object Model design pattern.

Notifications You must be signed in to change notification settings

markrepedersen/automark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dependencies

If using Chrome, then chromedriver 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.

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

Usage

npm i --save-dev automark
cd automark && npm install

Examples

  • You can find a sample project that uses the framework here.
  • The following is an example of how to design a test. It’s using Mocha and Chai, but you can use any testing frameworks you want.
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();
  });
});