Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates of namespaces and composer.json #8

Merged
merged 1 commit into from
Aug 18, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
BehatQAToolsExtension
=====================
BehatExtension
==============
10 changes: 3 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,14 @@
"name": "qa-tools/behat-extension",
"description": "QA-Tools extension for Behat",
"type": "library",
"keywords": ["behat","bdd","page","qa-tools","PageObject","HtmlElements"],
"keywords": ["Behat","BDD","page","QA-Tools","PageObject","HtmlElements"],
"homepage": "https://github.com/qa-tools/behat-extension",
"license": "BSD-3-Clause",
"require": {
"php": ">=5.3.1",
"behat/mink-extension": "*",
"behat/mink-extension": "~2.0@dev",
"qa-tools/qa-tools": "*@dev"
},
"minimum-stability": "dev",
"config": {
"bin-dir": "bin/"
},
"require-dev": {
"aik099/coding-standard": "dev-master",
"mockery/mockery": "~0.9"
Expand All @@ -25,7 +21,7 @@
},
"autoload-dev": {
"psr-0": {
"QATools\\behat": "tests/"
"tests\\QATools\\BehatExtension": "tests/"
}
},
"extra": {
Expand Down
5 changes: 3 additions & 2 deletions tests/QATools/behat/behat.yml → example/behat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,15 @@ default:
Behat\MinkExtension:
default_session: selenium2
javascript_session: selenium2
base_url: 'http://localhost'

selenium2: ~

evangelion1204\QAToolsExtension:
QATools\BehatExtension:
qa_tools:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact this is better, since we're testing same website that is accessed via MinkExtension, but have 2 different base_url settings which in fact can point to same direction.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one isn't done. If you have any objects, then feel free to express them.

base_url: 'http://localhost'
namespace:
pages: QATools\behat\pages
pages: pages
users:
test:
firstname: michael
Expand Down
26 changes: 26 additions & 0 deletions example/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "qa-tools/behat-extension-example",
"license": "BSD-3-Clause",
"require": {
"php": ">=5.3.1",
"qa-tools/qa-tools": "~1.0@dev",
"qa-tools/behat-extension": "~1.0@dev",
"mindplay/annotations": "~1.2@dev",
"behat/mink": "~1.5@dev",
"behat/mink-selenium2-driver": "~1.1@dev"
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look on whole require statement.

I recommend putting as close to reality versions here as possible:

  • "qa-tools/qa-tools": "~1.0@dev",
  • "qa-tools/behat-extension": "~1.0@dev",
  • "mindplay/annotations": "~1.2@dev",
  • "behat/mink": "~1.5@dev",
  • "behat/mink-selenium2-driver": "~1.1@dev"

"repositories": [
{
"type": "vcs",
"url": "https://github.com/qa-tools/behat-extension"
}
],
"autoload-dev": {
"psr-0": {
"pages": ""
}
},
"config": {
"bin-dir": "bin/"
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

use QATools\BehatExtension\Context\IQAToolsContext;
use QATools\BehatExtension\Context\QAToolsContext;

class MainContext extends IQAToolsContext
class MainContext extends QAToolsContext
{
protected static $folder = __DIR__;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# frontend/features/login.feature
Feature: Login
In order to use our site
In order to use the website site
As a website user
I need to login successfully

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @copyright Michael Geppert <[email protected]>
*/

namespace QATools\behat\pages;
namespace pages;


use QATools\QATools\HtmlElements\TypifiedPage;
Expand All @@ -17,7 +17,7 @@
/**
* Class TestPage
*
* @page-url('http://test.qa-tools.io/tests/aik099/QATools/HtmlElementsLive/Element/')
* @page-url('/example/fixtures/')
*/
class TestPage extends TypifiedPage
{
Expand All @@ -26,7 +26,7 @@ class TestPage extends TypifiedPage
* Input elements.
*
* @var WebElement
* @find-by('css' => '[name*=test]')
* @find-by('css' => 'input[name*=test]')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What *= means? Too short keyword for Google to find 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thats an CSS attribute selector, it just says that the name should contain test.
http://www.w3schools.com/css/css_attribute_selectors.asp

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK.

*/
protected $inputs;

Expand All @@ -38,10 +38,11 @@ class TestPage extends TypifiedPage
public function enter()
{
$this->inputs->click();
}

foreach ( $this->inputs as $input ) {
$input->click();
}
public function waitFor($timeout, $callback)
{
return ;
}

}
2 changes: 1 addition & 1 deletion src/QATools/BehatExtension/Context/QAToolsContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use Behat\Behat\Context\Context;
use QATools\BehatExtension\QATools;

class IQAToolsContext implements Context, IQAToolsAwareContext
class QAToolsContext implements Context, IQAToolsAwareContext
{

/**
Expand Down
1 change: 0 additions & 1 deletion src/QATools/BehatExtension/QATools.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use QATools\QATools\HtmlElements\TypifiedPageFactory;
use QATools\QATools\PageObject\Config\Config;
use QATools\QATools\PageObject\Page;
use QATools\QATools\PageObject\PageFactory;

class QATools
{
Expand Down