All Projects → testing-library → Testing Playground

testing-library / Testing Playground

Licence: mit
🐸 Simple and complete DOM testing playground that encourage good testing practices.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Testing Playground

Js Tracker
A chrome extension tracks front-end JavaScript that uses DOM / jQuery APIs to manipulate html dom elements (e.g., change style, attach event listener) at runtime.
Stars: ✭ 387 (-24.27%)
Mutual labels:  chrome-extension, dom
Awesome
🚀A curated list of awesome resources related to Alpine.
Stars: ✭ 502 (-1.76%)
Mutual labels:  dom
Qzoneexport
QQ空间导出助手,用于备份QQ空间的说说、日志、私密日记、相册、视频、留言板、QQ好友、收藏夹、分享、最近访客为文件,便于迁移与保存
Stars: ✭ 456 (-10.76%)
Mutual labels:  chrome-extension
Simpread
简悦 ( SimpRead ) - 让你瞬间进入沉浸式阅读的扩展
Stars: ✭ 5,352 (+947.36%)
Mutual labels:  chrome-extension
Darkness
Dark Themes for Popular Websites
Stars: ✭ 467 (-8.61%)
Mutual labels:  chrome-extension
Chameleon
Browser fingerprinting protection for everybody.
Stars: ✭ 489 (-4.31%)
Mutual labels:  chrome-extension
Icr
Interactive console for Crystal programming language
Stars: ✭ 452 (-11.55%)
Mutual labels:  repl
Search By Image
Browser extension for reverse image search, available for Edge, Chrome and Firefox
Stars: ✭ 500 (-2.15%)
Mutual labels:  chrome-extension
Markdown Viewer
Markdown Viewer / Browser Extension
Stars: ✭ 497 (-2.74%)
Mutual labels:  chrome-extension
Html5 Dom Document Php
A better HTML5 parser for PHP.
Stars: ✭ 477 (-6.65%)
Mutual labels:  dom
Nrepl
A Clojure network REPL that provides a server and client, along with some common APIs of use to IDEs and other tools that may need to evaluate Clojure code in remote environments.
Stars: ✭ 475 (-7.05%)
Mutual labels:  repl
Bunny
BunnyJS - Lightweight native (vanilla) JavaScript (JS) and ECMAScript 6 (ES6) browser library, package of small stand-alone components without dependencies: FormData, upload, image preview, HTML5 validation, Autocomplete, Dropdown, Calendar, Datepicker, Ajax, Datatable, Pagination, URL, Template engine, Element positioning, smooth scrolling, routing, inversion of control and more. Simple syntax and architecture. Next generation jQuery and front-end framework. Documentation and examples available.
Stars: ✭ 473 (-7.44%)
Mutual labels:  dom
Red
Red is a next-generation programming language strongly inspired by Rebol, but with a broader field of usage thanks to its native-code compiler, from system programming to high-level scripting and cross-platform reactive GUI, while providing modern support for concurrency, all in a zero-install, zero-config, single 1MB file!
Stars: ✭ 4,725 (+824.66%)
Mutual labels:  repl
Tracy
A tool designed to assist with finding all sinks and sources of a web application and display these results in a digestible manner.
Stars: ✭ 464 (-9.2%)
Mutual labels:  chrome-extension
Motus
Animation library that mimics CSS keyframes when scrolling.
Stars: ✭ 502 (-1.76%)
Mutual labels:  dom
Aria
下载可以很简单
Stars: ✭ 4,777 (+834.83%)
Mutual labels:  aria
Csshake
CSS classes to move your DOM!
Stars: ✭ 4,531 (+786.69%)
Mutual labels:  dom
Mitaka
A browser extension for OSINT search
Stars: ✭ 483 (-5.48%)
Mutual labels:  chrome-extension
Vue Perf Devtool
Vue Performance Devtool is a browser extension for inspecting the performance of Vue Components.
Stars: ✭ 510 (-0.2%)
Mutual labels:  chrome-extension
Chromeigstory
Chrome extension that lets you view your friend's Instagram Stories in the browser.
Stars: ✭ 502 (-1.76%)
Mutual labels:  chrome-extension

Testing-Playground

test-tube

Simple and complete DOM testing playground that encourage good testing practices.

online playground | next version


All Contributors

Playground for testing-library/dom

screenshot of unimported results

Testing-Library makes it easy to get started with testing. But even then, it can still be challenging to find the right queries or to understand why an element isn't being matched.

Testing-Playground provides you with direct feedback. Trying to visualize the direct impact of adding and removing specific (aria) attributes. All to give you some visual support while learning about the importance of aria roles, labels, and attributes.

Embedding

Testing-Playground can also be embedded. There is are two embed modes. Manual integration, and oembed.

Oembed

To get started with oembed, you'll simply need to copy / paste your direct playground links into a supporting platform.

Manual integration (demo)

Follow the following steps if you wish to have an interactive playground on your website.

Add the following snippet directly before your closing </body> tag:

<script async src="https://testing-playground.com/embed.js"></script>

Create a template element, in which you add to script tags. One for html and one for javascript. Make sure to type them correctly, as that's what our embedder uses to populate the different panes.

Note that the data-testing-playground attribute is required as well.

<template data-testing-playground>
  <script type="text/html"></script>

  <script type="text/javascript"></script>
</template>

Now, you can populate the html and javascript elements:

<template data-testing-playground>
  <script type="text/html">
    <button>one</button>
  </script>

  <script type="text/javascript">
    screen.getByRole('button');
  </script>
</template>

options

To configure your playground even further, add one or more of the following attributes to your opening <template> tag. Note, don't remove the data-testing-playground attribute!

attribute type default description
data-panes [markup | preview | query | result] ['markup', 'preview', 'query', 'result'] which panes to show, and in what order
data-height number | string 300 height of the element
data-width number | string '100% ' width of the element
data-loading eager | lazy 'lazy' load the frame eager or lazy (see iframe specs)

dynamic updates

Playground can be updated using cross-window messaging after it has been loaded. After the playground is loaded, you can update it with following message: {type: 'UPDATE_DATA', markup: 'new markup', query: 'new query'} with both markup and query being optional.

To find out, if playground is ready, you can listen for a message {source: 'embedded-testing-playground', type: 'READY'} in window from which are you embedding the playground.

Example:

<template data-testing-playground data-class="messaging-iframe"></template>
<script type="text/javascript">
  function updatePlayground() {
    const iframe = document.querySelector('.messaging-iframe');
    iframe.contentWindow.postMessage(
      { type: 'UPDATE_DATA', markup: 'new markup', query: 'new query' },
      'https://testing-playground.com',
    );
  }

  window.addEventListener('message', ({ data }) => {
    if (
      data.source === 'embedded-testing-playground' &&
      data.type === 'READY'
    ) {
      updatePlayground();
    }
  });
</script>

Roadmap

Future ideas are maintained in roadmap.md. Please use the issue tracker to discuss any questions or suggestions you have.

Every section in the roadmap is accompanied by one or more issues. Contributions are most welcome!

Contributing

Please see contributing.md for more details. If you just want to run the playground on your own machine, go to your terminal and enter the following commands:

git clone [email protected]:testing-library/testing-playground.git
cd testing-playground
npm ci
npm run start

Contributors

Thanks goes to these people (emoji key):


Stephan Meijer

🤔 💻 🚇 🚧

Marco Moretti

💻 ⚠️ 📖

Tim Deschryver

💻

Kent C. Dodds

🤔

Michaël De Boey

💻

Bianca Del Carretto

💻 📖

Gerrit Alex

💻 ⚠️

Dominik Guzy

💻

ConnorProgrammes

📖 💻

Jacob M-G Evans

💻 ⚠️

Sumeesh Nagisetty

👀

Flávio H Freitas

💻

Brandon Everett

💻

Michal Kočárek

💻 🤔

Alejandro Garcia Anglada

💻 📖 ⚠️

ddehart

💻 ⚠️

Balavishnu V J

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].