Minor - fix travis tests

pull/2487/head
jmontoyaa 7 years ago
parent af5c9f0269
commit 4acaaa2530
  1. 2
      .travis.yml
  2. 2
      config/packages/fos_user.yaml
  3. 4
      main/inc/lib/template.lib.php
  4. 4
      tests/behat/README.md
  5. 24
      tests/behat/features/accessCompanyReports.feature
  6. 7
      tests/behat/features/bootstrap/FeatureContext.php

@ -40,7 +40,7 @@ before_install:
#- sudo apt-get install google-chrome-stable #- sudo apt-get install google-chrome-stable
- google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost & - google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost &
# Get Chrome driver # Get Chrome driver
- wget https://chromedriver.storage.googleapis.com/2.34/chromedriver_linux64.zip && unzip chromedriver_linux64.zip - wget https://chromedriver.storage.googleapis.com/2.35/chromedriver_linux64.zip && unzip chromedriver_linux64.zip
- sudo mv chromedriver /usr/bin - sudo mv chromedriver /usr/bin
- sudo chmod +x /usr/bin/chromedriver - sudo chmod +x /usr/bin/chromedriver
# Setup display for Selenium # Setup display for Selenium

@ -1,5 +1,5 @@
fos_user: fos_user:
db_driver: orm # can be orm or odm db_driver: orm
firewall_name: admin firewall_name: admin
user_class: Chamilo\UserBundle\Entity\User user_class: Chamilo\UserBundle\Entity\User

@ -1523,7 +1523,7 @@ class Template
FormValidator::LAYOUT_BOX_NO_LABEL FormValidator::LAYOUT_BOX_NO_LABEL
); );
$params = [ $params = [
'id' => 'login', 'id' => '_username',
'autofocus' => 'autofocus', 'autofocus' => 'autofocus',
'icon' => 'user fa-fw', 'icon' => 'user fa-fw',
'placeholder' => get_lang('UserName'), 'placeholder' => get_lang('UserName'),
@ -1542,7 +1542,7 @@ class Template
$params $params
); );
$params = [ $params = [
'id' => 'password', 'id' => '_password',
'icon' => 'lock fa-fw', 'icon' => 'lock fa-fw',
'placeholder' => get_lang('Pass'), 'placeholder' => get_lang('Pass'),
]; ];

@ -1,7 +1,7 @@
In order to run behat tests locally with the right support for browser In order to run behat tests locally with the right support for browser
and JS environments under Linux, you will need to: and JS environments under Linux, you will need to:
- Download Selenium Standalone Server v3.* - Download Selenium Standalone Server v3.1.0
http://www.seleniumhq.org/download/ http://www.seleniumhq.org/download/
@ -17,7 +17,7 @@ Check the latest version at https://sites.google.com/a/chromium.org/chromedriver
then adapt the following command to the latest version: then adapt the following command to the latest version:
``` ```
cd /tmp && wget https://chromedriver.storage.googleapis.com/2.34/chromedriver_linux64.zip && unzip chromedriver_linux64.zip && sudo mv chromedriver /usr/local/bin cd /tmp && wget https://chromedriver.storage.googleapis.com/2.35/chromedriver_linux64.zip && unzip chromedriver_linux64.zip && sudo mv chromedriver /usr/local/bin
``` ```
### Chamilo configuration ### Chamilo configuration

@ -4,37 +4,33 @@ Feature: Access to portal reports as admin
As an administrator As an administrator
I need to be able to access the portal reports I need to be able to access the portal reports
Scenario: See the company reports link on the admin page Background:
Given I am a platform administrator Given I am a platform administrator
And I am on "/main/admin/index.php"
Scenario: See the company reports link on the admin page
Given I am on "/main/admin/index.php"
Then I should see "Reports" Then I should see "Reports"
Scenario: Access the company report Scenario: Access the company report
Given I am a platform administrator Given I am on "/main/mySpace/company_reports.php"
And I am on "/main/mySpace/company_reports.php"
Then I should not see "not authorized" Then I should not see "not authorized"
Scenario: Access the resumed version of the company report Scenario: Access the resumed version of the company report
Given I am a platform administrator Given I am on "/main/mySpace/company_reports_resumed.php"
And I am on "/main/mySpace/company_reports_resumed.php"
Then I should not see "not authorized" Then I should not see "not authorized"
Scenario: See the company reports link on the admin page Scenario: See the company reports link on the admin page
Given I am a platform administrator Given I am on "/main/admin/teacher_time_report.php"
And I am on "/main/admin/teacher_time_report.php"
Then I should see "Teachers time report" Then I should see "Teachers time report"
Scenario: See the company reports link on the admin page Scenario: See the company reports link on the admin page
Given I am a platform administrator Given I am on "/main/admin/teacher_time_report.php"
And I am on "/main/admin/teacher_time_report.php"
Then I should not see "not authorized" Then I should not see "not authorized"
Scenario: See the company reports link on the admin page Scenario: See the company reports link on the admin page
Given I am a platform administrator Given I am on "/main/admin/teachers_time_by_session_report.php"
And I am on "/main/admin/teachers_time_by_session_report.php"
Then I should see "Teachers time report by session" Then I should see "Teachers time report by session"
Scenario: See the company reports link on the admin page Scenario: See the company reports link on the admin page
Given I am a platform administrator Given I am on "/main/admin/teachers_time_by_session_report.php"
And I am on "/main/admin/teachers_time_by_session_report.php"
Then I should not see "not authorized" Then I should not see "not authorized"

@ -111,16 +111,19 @@ class FeatureContext extends MinkContext
} }
/** /**
*
* @Given /^I am logged as "([^"]*)"$/ * @Given /^I am logged as "([^"]*)"$/
*/ */
public function iAmLoggedAs($username) public function iAmLoggedAs($username)
{ {
$this->visit('/index.php?logout=logout'); $this->visit('/index.php?logout=logout');
$this->iAmOnHomepage(); $this->iAmOnHomepage();
$this->fillFields(new \Behat\Gherkin\Node\TableNode([ /*$this->fillFields(new \Behat\Gherkin\Node\TableNode([
['_username', $username], ['_username', $username],
['_password', $username] ['_password', $username]
])); ]));*/
$this->fillField('_username', $username);
$this->fillField('_password', $username);
$this->pressButton('submitAuth'); $this->pressButton('submitAuth');
} }

Loading…
Cancel
Save