qa-tools / behat-extension Goto Github PK
View Code? Open in Web Editor NEWBehat extension for integration with QA-Tools
License: BSD 3-Clause "New" or "Revised" License
Behat extension for integration with QA-Tools
License: BSD 3-Clause "New" or "Revised" License
name
key) to: qa-tools/behat-extension
"behat/mink": "dev-master",
), because MinkExtension already has it"aik099/qa-tools": "dev-master"
) to *@dev
, because it's valid version format and it will automatically pickup release when it happens, while dev-master
is fixed link to master
branch"minimum-stability": "dev",
, maybe it's not needed at all and better to specify @dev
in required package version in project's own composer.json
repositories
key, because qa-tools library is already published on packagistautoload
into autoload
(for main code) and autoload-dev
(for tests)aik099/qa-tools
to qa-tools\qa-tools
I see following steps that might come in handy:
I visit {PageClass} page
- will:
$this->page
(of FeatureContext)$this->page->open()
Also we need to implement existing steps (from MinkContext
) in a way, that they would access $this->page
instead of using $this->session
directly.
Need to migrate repo from https://github.com/evangelion1204/BehatQAToolsExtension location.
To to do this just need to:
origin
remote url to [email protected]:qa-tools/behat-extension.git
Currently the evangelion1204\QAToolsExtension
namespace is used in PHP. This needs to be changed to QATools\BehatExtension
to match with PSR-0.
MinkExtension
in composer.json
services.xml
README.md
in installation instructions, that MinkExtension
needs to be configured upfront in behat.yml
file (with a link to how to page on Behat website)Keep base_url
option within qa_tools
extension options group even though we have same option in MinkExtension as well, because I see no way right now how to obtain it's value from within another extension.
Many pages need user data e.g.login or register.
It should be possible to specify users in the behat.yml
and use this saved data to fill forms or write custom steps:
default:
QATools\BehatExtension:
users:
registered:
firstname: michael
lastname: geppert
public function fillLoginForm()
{
$user = $this->getUser('registered');
$this->loginForm->fill($user->getData());
}
public function enterFirstname()
{
$user = $this->getUser('registered');
$this->firstname->setValue($user->get('firstname'));
}
Normally only one user is active at time. Therefore extend the whole feature with an active user and specific steps to load him.
For example:
Scenario: A basic registration of an user
Given "valid" as user
The PageFactory is created only once (when extension is initialized - https://github.com/qa-tools/behat-extension/blob/master/src/QATools/BehatExtension/QATools.php#L78) and therefore it uses Mink's session available at the moment.
Such setup however is can backfire when multiple sessions are configured in MinkExtension
. The MinkExtension
works like this:
To solve this we need to have separate page factory instance created per session and call ->getPageFactory()
(instead of ->pageFactory
) that will:
->pageFactories
array (key is Mink's session name, value is page factory created for it)Thanks to caching in ->pageFactories
array we don't need to create new page factory for each scenario.
To allow the user to get started we should create a behat-extension-skeleton
or behat-extension-example
to get started.
This could be a template to get started or to get an idea how to use the extension and QA-Tools in general.
Describe installation & usage in the README.md file
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.