Skip to content

ghoshasish99/Puppeteer-Jest

Repository files navigation

Puppeteer with Jest

Puppeteer-Jest

Puppeteer is a Node library which provides a high-level API to control Chrome or Chromium over the DevTools Protocol. Puppeteer runs headless by default, but can be configured to run full (non-headless) Chrome or Chromium.

For more details visit this page

npm install puppeteer
npm install jest
npm install jest-puppeteer

Demos

We do have a live Storybook which shows all our components.

Please note: This project uses Yarn Workspaces. If you want to run all demos locally you need to get Yarn and install all dependencies by executing yarn install.

The code examples make use of Javascript tagged template literals which are a key component of the lit-html engine used in Lion. Additionally imports like import '@lion/form/lion-form.js' need to be transformed somehow, for example by es-dev-server.

Features

  • High Performance - Focused on great performance in all relevant browsers with a minimal number of dependencies
  • Accessibility - Aimed at compliance with the WCAG 2.1 AA standard to create components that are accessible for everybody
  • Flexibility - Provides solutions through Web Components and JavaScript classes which can be used, adopted and extended to fit all needs
  • Pure ES Modules
  • Exposes functions/classes and Web Components

Note: These demos may look a little bland but that is on purpose. They only come with functional stylings. This makes sense as the main use case is to extend those components and if you do you do not want to override existing stylings.

How to install

npm i @lion/<package-name>

How to use

Extend a Web Component

This is the main use case for lion. To import component classes, and extend them for your own design system's components.

import { css } from '@lion/core';
import { LionInput } from '@lion/input';

class MyInput extends LionInput {
  static get styles() {
    return [
      super.styles,
      css`
        /* your styles here */
      `,
    ];
  }
}
customElements.define('my-input', MyInput);

Use a JavaScript system

There's a couple of "systems" in lion which have a JavaScript API. Examples are localize, overlays, ajax, etc.

<script type="module">
  import { ajax } from '@lion/ajax';

  ajax.get('data.json').then(response => {
    // most likely you will use response.data
  });
</script>

Use a Web Component

You can also use the lion elements directly, although this is likely not a common use case.

<script type="module">
  import '@lion/input/lion-input.js';
</script>

<lion-input name="firstName"></lion-input>

Issues

If you encouter an issue with any of the packages we are offering please open a new bug issue. Be sure to include a description of the expected and the current behavior - additional adding a reproduction always helps.

Feature requests

When you have an idea on how we could improve, please check our discussions to see if there are similar ideas or feature requests. If there are none, please start your feature request as a new discussion topic. Add the title [Feature Request] My awesome feature and a description of what you expect from the improvement and what the use case is.

Content

Lion web components is logically organized in groups of systems.

The accessibility column indicates whether the functionality is accessible in its core. Aspects like styling and content determine actual accessibility in usage.

Package Version Description Accessibility
-- Form System -- A system that lets you make complex forms with ease, including: validation, translations. ✔️
combobox combobox Text box controlling popup listbox ✔️
form form Wrapper for multiple form elements ✔️
form-core form-core Core functionality for all form controls ✔️
form-integrations form-integrations Shows form elements in an integrated way ✔️
fieldset fieldset Group for form inputs ✔️
checkbox-group checkbox-group Group of checkboxes ✔️
input input Input element for strings ✔️
input-amount input-amount Input element for amounts ✔️
input-date input-date Input element for dates ✔️
input-datepicker input-datepicker Input element for dates with a datepicker ✔️
input-email input-email Input element for e-mails ✔️
input-iban input-iban Input element for IBANs ✔️
input-range input-range Input element for a range of values ✔️
input-stepper input-stepper Input stepper element for the predefined range ✔️
listbox listbox Interactive list with selectable options ✔️
radio-group radio-group Group of radios ✔️
select select Simple native dropdown element ✔️
select-rich select-rich 'rich' version of the native dropdown element #243
textarea textarea Multiline text input ✔️
-- Button System -- These web components bring common UX patterns while still full integrated with (native) forms.
button button Button ✔️
switch switch Switch ✔️
-- Overlay System -- If something needs to overlay content this is your place.
overlays overlays Overlay System ✔️
dialog dialog Dialog element ✔️
tooltip tooltip Tooltip element #175
-- Navigation System -- Components which are used to guide users
accordion accordion Accordion ✔️
pagination pagination Pagination ✔️
steps steps Multi Step System n/a
tabs tBS Move between a small number of equally important views n/a
-- localize System -- Localize text, numbers, dates and a way to store/fetch these data.
localize localize Localize and translate your application/components n/a
-- Icon System -- Loading and displaying icons
icon icon Display our svg icons #173, #172
-- Others -- Features not fitting any other category
core core Core System (exports LitElement, lit-html) n/a
ajax ajax Fetching data via ajax request n/a
calendar calendar Standalone calendar #195, #194
collapsible collapsible Combination of a button and a chunk of extra content ✔️
-- Helpers -- helpers Helpers to make your and your life easier
sb-action-logger Storybook action logger

Technologies

Lion Web Components aims to be future proof and use well-supported proven technology. The stack we have chosen should reflect this.

Rationale

We know from experience that making high quality, accessible UI components is hard and time consuming: it takes many iterations, a lot of development time and a lot of testing to get a generic component that works in every context, supports many edge cases and is accessible in all relevant screen readers.

Lion aims to do the heavy lifting for you. This means you only have to apply your own Design System: by delivering styles, configuring components and adding a minimal set of custom logic on top.

Coding guidelines

Check out our coding guidelines for more detailed information.

How to contribute

Lion Web Components are only as good as its contributions. Read our contribution guide and feel free to enhance/improve Lion. We keep feature requests closed while we're not working on them.

Contact

Feel free to create a github issue for any feedback or questions you might have. You can also find us on the Polymer slack in the #lion channel.

You can join the Polymer slack by visiting https://www.polymer-project.org/slack-invite.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published