npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@trendyol/baklava-cypress-plugin

v0.0.1

Published

baklava cypress plugin

Downloads

54

Readme

Cypress Baklava Test Plugin

This Cypress plugin is designed to test the open-source UI library used in our company. The plugin includes customized Cypress commands to facilitate testing of some commonly used UI elements. Below are examples of how to use this plugin.

Installation

  1. Make sure you have added Cypress to your project. If you haven't added it yet, you can follow the Cypress Installation guide.

  2. Use the following command to add this plugin to your project:

    npm i --save @trendyol/baklava-cypress-plugin
  3. Create a test file in your Cypress project and start using this plugin.

  4. To add Cypress commands to the commands.js file, you can do the following. You can find this file in the support folder of your Cypress project. If there is no commands.js file, you should create one.

    Open the commands.js file and add the following commands:

    // Contains general commands for the plugin.
    import '@trendyol/baklava-cypress-plugin/src/baklava/general.command';
    
    // Adds necessary commands for Button.
    import '@trendyol/baklava-cypress-plugin/src/baklava/bl-button.command';
    
    // Adds necessary commands for Input.
    import '@trendyol/baklava-cypress-plugin/src/baklava/bl-input.command';
    
    // If you want to add more commands, you can do so here.

    This code will import the necessary Cypress commands into the commands.js file. This way, you can use these commands in all your test files. If you need to add other commands like bl-select, bl-checkbox, bl-switch, etc., you can import them in a similar way.

Usage

Below are some examples of using this plugin. Each example focuses on testing a specific UI element.

Button Test

cy.blButton("baklava-button")
  .kind("primary")
  .variant("primary")
  .icon("search")
  .isDisabled(false)
  .contains("Baklava")
  .click();

Input Test

cy.blInput("baklava-input")
  .type("Baklava")
  .placeholder("Enter Your Password")
  .helpText("Password must be at least 8 characters")
  .icon("lock")
  .label("Password")
  .should("have.value", "Baklava")
  .isDisabled(false)
  .clear();

Similar tests can be created for other UI elements. There is a separate Cypress command for each feature.

  1. Select: cy.blSelect()
  2. Checkbox: cy.blCheckbox()
  3. Switch: cy.blSwitch()
  4. Textarea: cy.blTextarea()
  5. Alert: cy.blAlert()
  6. Badge: cy.blBadge()
  7. Icon: cy.blIcon()

Each is designed to test a specific UI element, and you can interact with these elements using Cypress commands. For more information, it is useful to review the documentation of the plugin.

Contribution

If you want to improve or fix bugs in this plugin, please contribute via GitHub repository. Pull requests and issue reports are always welcome.

License

This plugin is open source and distributed under the MIT License.