Commit d29c7ade authored by Christian Keuerleber's avatar Christian Keuerleber

TASK: initialize project, add login test

parents
/vendor/
/Tests/_output/
/Tests/_support/_generated/
<?php
namespace Helper;
// here you can define custom actions
// all public methods declared in helper class will be available in $I
class Monitoring extends \Codeception\Module
{
}
<?php
use PunktDe\Codeception\Webdriver\ActorTraits\Webdriver;
/**
* Inherited Methods
* @method void wantToTest($text)
* @method void wantTo($text)
* @method void execute($callable)
* @method void expectTo($prediction)
* @method void expect($prediction)
* @method void amGoingTo($argumentation)
* @method void am($role)
* @method void lookForwardTo($achieveValue)
* @method void comment($description)
* @method void pause()
*
* @SuppressWarnings(PHPMD)
*/
class MonitoringTester extends \Codeception\Actor
{
use _generated\MonitoringTesterActions;
use Webdriver;
}
# Codeception Test Suite Configuration
#
# Suite for monitoring tests.
# Perform tests in browser using the WebDriver or PhpBrowser.
# If you need both WebDriver and PHPBrowser tests - create a separate suite.
actor: MonitoringTester
modules:
enabled:
- Webdriver:
browser: chrome
url: https://my.typo3.org
restart: true
window_size: 1920x2080
capabilities:
chromeOptions:
args:
- '--headless'
- '--disable-gpu'
- '--disable-dev-shm-usage'
- '--no-sandbox'
- \Helper\Monitoring
step_decorators: ~
Feature: As a website user
in order to see my personal data
I need to be able to log in
# TODO get rid of the "wait for 1 seconds" steps - potentially saving up to 6 seconds per test run
# TODO to do that we need elements to see if the ajax login is started and finished and if the page is loaded
Scenario: Login works
Given I am on "/"
And I wait for the "._login > a" element to be visible
# if we don't wait here the test clicks on the button before the flyout is initialized, initializing closes the flyout again
And I wait for 1 seconds
And I click on "._login > a"
And I wait for the "#login-user" element to be visible
Then I should see "Enter your credentials below to sign in"
When I fill in "user" with "t3o_monitoring"
And I fill in "pass" with "t3o_monitoring_password"
And I submit form "#login-form"
# we don't really know when the page is loaded so we just wait some time
And I wait for 1 seconds
And I wait for the "._login > a" element to be visible
# if we don't wait here the test clicks on the button before the flyout is initialized, initializing closes the flyout again
And I wait for 1 seconds
And I click on "._login > a"
# in the flyout there is no recognizable element to wait for
And I wait for 1 seconds
And I wait for the text "Hello Monitoring user"
Then I should see "Hello Monitoring user"
When I click on "Logout"
# we don't really know when the page is loaded so we just wait some time
And I wait for 1 seconds
And I wait for the "._login > a" element to be visible
# if we don't wait here the test clicks on the button before the flyout is initialized, initializing closes the flyout again
And I wait for 1 seconds
And I click on "._login > a"
And I wait for the "#login-user" element to be visible
And I wait for the text "Enter your credentials below to sign in"
Then I should see "Enter your credentials below to sign in"
paths:
tests: Tests
output: Tests/_output
data: Tests/_data
support: Tests/_support
envs: Tests/_envs
actor_suffix: Tester
extensions:
enabled:
- Codeception\Extension\RunFailed
{
"name": "t3o/my_monitoring",
"require-dev": {
"punktde/codeception-webdriver": "^1.1.0",
"punktde/codeception-mailhog": "^1.1.0",
"punktde/codeception-filesystem": "^1.1.0",
"punktde/codeception-database": "^1.1.0",
"punktde/codeception-cli": "^1.1.0",
"codeception/codeception": "^3.1"
},
"authors": [
{
"name": "Christian Keuerleber",
"email": "keuerleber@punkt.de"
}
],
"require": {}
}
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment