Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import stampit from "stampit";
export const Cloneable = stampit.init(({ instance, stamp }) => {
// Avoid adding the same method to the prototype twice.
if (!stamp.fixed.methods.clone) {
stamp.fixed.methods.clone = function () {
return stamp(this);
};
}
});
export const Frozen = stampit().init(({instance}) => {
Object.freeze(instance);
});
'use strict';
const stampit = require('stampit');
const { By } = require('selenium-webdriver');
const TodoListItem = stampit
.init(function ({ webElement }) {
this.isComplete = async function isComplete() {
const TodoList = require('./todo-list.page');
const listElement = await webElement.findElement(By.xpath('..'));
const todoList = TodoList({ webElement: listElement });
return todoList.isComplete();
};
this.delete = async function _delete() {
const button = await webElement.findElement(By.className('remove'));
return button.click();
};
this.complete = async function complete() {
'use strict';
const stampit = require('stampit');
const { By } = require('selenium-webdriver');
const AddButton = stampit.init(function ({ driver }) {
const findElement = () => driver.findElement(By.css('header button'));
this.isEnabled = async function isEnabled() {
const element = await findElement();
return element.isEnabled();
};
this.click = async function click() {
const element = await findElement();
return element.click();
};
});