Decathlon / tzatziki

Decathlon library to ease and promote Test Driven Development of Java microservices!
Apache License 2.0
62 stars 30 forks source link

[Tzatziki Front] CSS Selector Referential #261

Open alexandrepa opened 7 months ago

alexandrepa commented 7 months ago

In a lot of scenario, you want to check on the same type of html element across multiple tests. \ Those css selectors are some times really complex and really not readable if present in a lot of tests.

The idea is to offer the possibility to specify those 'constant css selectors' in a parameter file that can be used directly in Gherkins syntax.

For example, in src/test/resources/css_const.yml :

save-button: "//button[contains(@class,'MuiButton-root') and @aria-label='Save']"

We can directly use it in feature test :

we perform a CLICK on save-button

We can also imagine some specific css_const yaml file that can override global const for specific features.

Maybe also add the possibility to use variable in constant :

mui-button: "//button[contains(@class,'MuiButton-root') and @aria-label=%1]"
we perform a CLICK on click-button('Save')
### Tasks
- [ ] https://github.com/Decathlon/tzatziki/issues/262