Providers which return instances of classes other than FtrService will likely remain supported for as long as possible. We expect to fully deprecate and remove support for async service providers in the near future and instead require that services use the lifecycle service to run setup before tests. Currently these providers may also return a Promise for the service instance, allowing the service to do some setup work before tests run. These instances are cached and provided to tests. These are functions which which create service instances and return them. When you write your own functional tests check for existing services that help with the interactions you’re looking to execute, and add new services for interactions which aren’t already encoded in a service.įor legacy purposes, and for when creating a subclass of FtrService is inconvenient, you can also create services using a "Service Provider". All functionality except the mocha API is exposed via services. Tests and other services can retrieve service instances by asking for them by name. Provider functions will always be called with a single argument: a provider API (see the Provider API Section).Ī Service is a named singleton created using a subclass of FtrService. Any of these Provider functions may be asynchronous and should return/resolve-to the value they are meant to provide. Definitions editĬode run by the FunctionalTestRunner is wrapped in a function so it can be passed around via config files and be parameterized. The FunctionalTestRunner automatically transpiles functional tests using babel, so that tests can use the same ECMAScript features that Kibana source code uses. We use browser service and webElementWrapper class to wrap up Webdriver API. When the FunctionalTestRunner launches, remote service creates a new webdriver session, which starts the driver and a stripped-down browser instance. We use WebDriver Protocol to run tests in both Chrome and Firefox with the help of chromedriver and geckodriver. The tests are written in mocha using for assertions. Writing functional tests edit Environment edit Logging can also be customized with -quiet, -debug, or -verbose flags. For instance, use -grep=foo to run only tests that match a regular expression. ![]() There are also command line flags for -bail and -grep, which behave just like their mocha counterparts. -config test/accessibility/config.ts starts Elasticsearch and Kibana servers with the WebDriver tests configured to run an accessibility audit using axe.-config test/api_integration/config.js starts Elasticsearch and Kibana servers with the api integration tests configuration.-config test/functional/ starts Elasticsearch and Kibana servers with the WebDriver tests configured to run in Firefox.-config test/functional/config.js starts Elasticsearch and Kibana servers with the WebDriver tests configured to run in Chrome.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |