Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Test framework for running UI tests in Chrome with visual regression testing options
Muppeteer is a test framework for running UI tests in Chrome. It is composed of:
Muppeteer provides a convenient test API which abstracts away boilerplate setup code. It's loosely based on PhantomCSS, which runs visual comparisons of images in a (deprecated) PhantomJS world.
const container = '.todoapp';
const input = 'header input';
const listItem = '.todo-list li';
const firstItem = listItem + ':nth-of-type(1)';
const firstItemToggle = firstItem + ' .toggle';
const firstItemRemoveButton = firstItem + ' button';
const secondItem = listItem + ':nth-of-type(2)';
const todoCount = '.todo-count';
ddescribeComponent({name: 'todomvc', url: 'http://todomvc.com/examples/react/#/'}, function() {
describe('Add a todo item', async function() {
it('typing text and hitting enter key adds new item', async function() {
await Muppeteer.page.waitForSelector(input);
await Muppeteer.page.type(input, 'My first item');
await Muppeteer.page.keyboard.press('Enter');
await Muppeteer.page.waitForSelector(firstItem);
Muppeteer.assert.equal(await Muppeteer.page.getText(firstItem), 'My first item');
await Muppeteer.assert.visual(container);
});
it('clicking checkbox marks item as complete', async function() {
await Muppeteer.page.waitForSelector(firstItemToggle);
await Muppeteer.page.click(firstItemToggle);
await Muppeteer.page.waitForNthSelectorAttributeValue(listItem, 1, 'class', 'completed');
await Muppeteer.assert.visual(container);
});
it('typing more text and hitting enter adds a second item', async function() {
await Muppeteer.page.type(input, 'My second item');
await Muppeteer.page.keyboard.press('Enter');
await Muppeteer.page.waitForSelector(secondItem);
Muppeteer.assert.equal(await Muppeteer.page.getText(secondItem), 'My second item');
await Muppeteer.assert.visual(container);
});
it('hovering over first item shows x button', async function() {
await Muppeteer.page.hover(firstItem);
await Muppeteer.assert.visual(container);
});
it('clicking on first item x button removes it from the list', async function() {
await Muppeteer.page.click(firstItemRemoveButton);
await Muppeteer.page.waitForElementCount(listItem, 1);
Muppeteer.assert.equal(await Muppeteer.page.getText(todoCount), '1 item left');
await Muppeteer.assert.visual(container);
});
});
});
Baseline images:
FAQs
Visual regression testing framework for running UI tests in Chrome
The npm package muppeteer receives a total of 11 weekly downloads. As such, muppeteer popularity was classified as not popular.
We found that muppeteer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.