elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.65k stars 8.23k forks source link

[FTR] Add Gherkin feature spec support #63892

Closed spalger closed 2 years ago

spalger commented 4 years ago

The uptime team would like to start using the Gherkin language to describe features to replicate the BDD style supported by cucumber. Adding support for this to the functional test runner would allow them to write feature specs in Gherkin syntax like below:

# https://github.com/elastic/kibana/blob/master/x-pack/legacy/plugins/apm/e2e/cypress/integration/apm.feature
Feature: APM

  Scenario: Transaction duration charts
    Given a user browses the APM UI application
    When the user inspects the opbeans-node service
    Then should redirect to correct path with correct params
      And should have correct y-axis ticks

This is paired with JavaScript files that define what should happen at each step defined, similar to below:

const PageObjects = getPageObjects(['common']);

Given('a user browses the APM UI application', async () => {
  await PageObjects.common.navigateToApp('apm')
});

// ... more definitions

The idea is that the functional test runner configs could enable "bdd feature testing", or something similar, and then the functional test runner would parse the features/**/*.feature files next to the config file and convert them into tests that the FTR knows how to execute, pulling in the logic defined by step definitions in step_definitions/**/*.{js,ts} (relative to the config file again).

This would allow us to experiment with this new structure for defining tests while reusing the existing functional test runner services/reporting/integrations and allow teams to adopt this style of defining tests if they wish.

cc: @mdelapenya

elasticmachine commented 4 years ago

Pinging @elastic/kibana-operations (Team:Operations)

mdelapenya commented 4 years ago

Hi 👋! Is there any progress on this issue? Please let me know if there is anything I can do on my end to push this feature into FTR

Cheers!

tylersmalley commented 2 years ago

We're working on defining the requirements to replace the functional test runner, so it's unlikely that this change will be made to the existing FTR. I have added it to our project spec doc and will share it when it's ready.