How to use the stampit.conf function in stampit

To help you get started, we’ve selected a few stampit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github char0n / page-objects / src / todo-list-app.page.js View on Github external
'use strict';

const stampit = require('stampit');
const { By } = require('selenium-webdriver');

const TodoList = require('./todo-list.page');
const TodoListItemCreator = require('./todo-list-item-creator.page');


const TodoListApp = stampit
  .conf({
    baseUrl: process.env.BASE_URL,
  })
  .init(function ({ driver }, { stamp }) {
    this.open = async function open(location = '') {
      return driver.get(`${stamp.compose.configuration.baseUrl}${location}`);
    };

    this.close = async function close() {
      return driver.quit();
    };

    this.getTodoItemCreator = function getTodoItemCreator() {
      return TodoListItemCreator({ driver });
    };

stampit

Create objects from reusable, composable behaviors.

MIT
Latest version published 3 years ago

Package Health Score

62 / 100
Full package analysis