Skip to content
This repository has been archived by the owner on Jun 23, 2021. It is now read-only.

Suggestion - Add testkit tool #170

Open
hepiyellow opened this issue Nov 4, 2018 · 2 comments
Open

Suggestion - Add testkit tool #170

hepiyellow opened this issue Nov 4, 2018 · 2 comments

Comments

@hepiyellow
Copy link
Contributor

The testkit tool can generate testkit (drivers) for testing.

A testkit can be devided into 2 parts: selectors, actions.

Selectors

The selectors can be easily defined in the meta data file.
For example using data-hook values.
something like:

const name = 'textContent`
const selector = `[data-hook="text-content"]`;
compMetadata.addElementSelector({name, selector});

This metadata should be independent of any testing framework (dom, protractor, puppeteer)

Actions

We can have metadata for common actions: focus, click, hover

The metadata should include the element selectors which should accept an action.
For example:

const name = 'closeButton`
const selector = `[data-hook="close-button"]`;
const actions: = [  focusable, clickable];
]
popoverMetadata.addElement({name, selector, focusable: true, actions});

Then we can generate a driver with a method:

const driver = {
  clickCloseButton()
  focusCloseButton()
}

This actions part is not refined yet, just an idea.

@JoMarton
Copy link
Contributor

JoMarton commented Nov 4, 2018

@hepiyellow the metadata file contains general info about the component and possible simulations (combination of props and state).

It isn't a unit or "interaction" tesging replacement, at least not currently.

If you want to simulate some actions, you can probably achieve that with a combination of state & props without defining interaction.

@hepiyellow
Copy link
Contributor Author

I said, we would generate a driver.
I didn't say we would run interaction tests.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants