This repository was archived by the owner on Mar 17, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 28
[tests] new convention for locating elements #13
Closed
javigomez
wants to merge
1
commit into
joomla-projects:staging
from
javigomez:jab16GherkinpageObjectsandSteps
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
namespace Page\Acceptance\Administrator; | ||
|
||
class Login extends \AcceptanceTester | ||
{ | ||
/** | ||
* @When I login into Joomla Administrator with username :arg1 and password :arg1 | ||
*/ | ||
public function login($username, $password) | ||
{ | ||
$I = $this; | ||
$I->amOnPage('administrator/'); | ||
$I->fillField(['css' => 'input[data-tests="username"'], $username); | ||
$I->fillField(['css' => 'input[data-tests="password"'], $password); | ||
$I->click(['css' => 'button[data-tests="log in"']); | ||
$I->doAdministratorLogout(); | ||
} | ||
} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
namespace Step\Acceptance\Administrator; | ||
|
||
class User extends \AcceptanceTester | ||
{ | ||
/** | ||
* @Given I am registered administrator named :arg1 | ||
*/ | ||
public function iAmRegisteredAdministratorNamed($arg1) | ||
{ | ||
$I = $this; | ||
$I->comment('@todo'); | ||
} | ||
|
||
/** | ||
* @Then I should see administrator dashboard | ||
*/ | ||
public function iShouldSeeAdministratorDashboard() | ||
{ | ||
$I = $this; | ||
$I->comment('@todo'); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,4 +30,10 @@ modules: | |
language: 'English (United Kingdom)' # Language in which you want the Application to be Installed | ||
AcceptanceHelper: | ||
url: 'http://localhost/tests/joomla-cms3' # the url that points to the joomla installation at /tests/system/joomla-cms - we need it twice here | ||
error_level: "E_ALL & ~E_STRICT & ~E_DEPRECATED" | ||
error_level: "E_ALL & ~E_STRICT & ~E_DEPRECATED" | ||
gherkin: | ||
contexts: | ||
default: | ||
- AcceptanceTester | ||
- Step\Acceptance\Administrator\User | ||
- Page\Acceptance\Administrator\Login | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @pritalpatel check here how we load the Page Object |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1 @@ | ||
<?php | ||
// Here you can initialize variables that will be available to your tests | ||
|
||
\Codeception\Util\Autoload::registerSuffix('Steps', __DIR__. DIRECTORY_SEPARATOR . '_steps'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Feature: administrator login | ||
In order to manage my web application | ||
As administrator | ||
I need to be able to login | ||
|
||
Scenario: Successful login | ||
Given I am registered administrator named "admin" | ||
When I login into Joomla Administrator with username "admin" and password "admin" | ||
Then I should see administrator dashboard |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pritalpatel this is the page object that represents the Administrator -> Login Page