MOBILE-4470 login: Fix sites list
parent
55c083daf0
commit
c821ab03d0
|
@ -599,7 +599,10 @@ class behat_app extends behat_app_helper {
|
||||||
*/
|
*/
|
||||||
public function the_app_has_the_following_config(TableNode $data) {
|
public function the_app_has_the_following_config(TableNode $data) {
|
||||||
foreach ($data->getRows() as $configrow) {
|
foreach ($data->getRows() as $configrow) {
|
||||||
$this->appconfig[$configrow[0]] = json_decode($configrow[1]);
|
$name = $configrow[0];
|
||||||
|
$value = $this->replace_wwwroot($configrow[1]);
|
||||||
|
|
||||||
|
$this->appconfig[$name] = json_decode($value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -242,7 +242,7 @@ class behat_app_helper extends behat_base {
|
||||||
// Assert initial page.
|
// Assert initial page.
|
||||||
$this->spin(function($context) {
|
$this->spin(function($context) {
|
||||||
$page = $context->getSession()->getPage();
|
$page = $context->getSession()->getPage();
|
||||||
$element = $page->find('xpath', '//page-core-login-site//input[@name="url"]');
|
$element = $page->find('xpath', '//page-core-login-site');
|
||||||
|
|
||||||
if ($element) {
|
if ($element) {
|
||||||
// Login screen found.
|
// Login screen found.
|
||||||
|
|
|
@ -120,7 +120,7 @@
|
||||||
</ion-thumbnail>
|
</ion-thumbnail>
|
||||||
<ion-label>
|
<ion-label>
|
||||||
<p *ngIf="site.title" class="item-heading ion-text-wrap">{{site.title}}</p>
|
<p *ngIf="site.title" class="item-heading ion-text-wrap">{{site.title}}</p>
|
||||||
<p *ngIf="displaySiteUrl(site.siteUrl)">{{site.noProtocolUrl}}</p>
|
<p *ngIf="displaySiteUrl(site.url)">{{site.noProtocolUrl}}</p>
|
||||||
<p *ngIf="site.location">{{site.location}}</p>
|
<p *ngIf="site.location">{{site.location}}</p>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
|
|
|
@ -37,9 +37,8 @@ Feature: Test basic usage of login in app
|
||||||
| Username | student1 |
|
| Username | student1 |
|
||||||
| Password | student1 |
|
| Password | student1 |
|
||||||
And I press "Log in" near "Lost password?" in the app
|
And I press "Log in" near "Lost password?" in the app
|
||||||
Then I should find "Acceptance test site" in the app
|
Then the header should be "Acceptance test site" in the app
|
||||||
And the UI should match the snapshot
|
And the UI should match the snapshot
|
||||||
But I should not find "Log in" in the app
|
|
||||||
|
|
||||||
Scenario: Add a non existing account
|
Scenario: Add a non existing account
|
||||||
When I launch the app
|
When I launch the app
|
||||||
|
@ -160,3 +159,21 @@ Feature: Test basic usage of login in app
|
||||||
When I press "OK" in the app
|
When I press "OK" in the app
|
||||||
And I press "Lost password?" in the app
|
And I press "Lost password?" in the app
|
||||||
Then I should find "Contact support" in the app
|
Then I should find "Contact support" in the app
|
||||||
|
|
||||||
|
Scenario: Shows sites list
|
||||||
|
Given the app has the following config:
|
||||||
|
| sites | [{"name":"Xavier's School for Gifted Youngsters","alias":"XSGY","imageurl":"https://x-school.campus.edu/logo.png","city":"North Salem","countrycode":"US","url":"https://x-school.campus.edu"},{"name":"Hogwarts", "url":"https://hogwarts.campus.edu"},{"name":"Acceptance test site","url":"$WWWROOT"}] |
|
||||||
|
When I launch the app
|
||||||
|
Then I should find "Xavier's School for Gifted Youngsters (XSGY)" in the app
|
||||||
|
|
||||||
|
When I replace "/.*/" within "ion-list ion-item:last-of-type ion-label p:last-of-type" with "campus.example.edu"
|
||||||
|
Then the UI should match the snapshot
|
||||||
|
|
||||||
|
When I press "Acceptance test site" in the app
|
||||||
|
Then I should find "Log in" in the app
|
||||||
|
|
||||||
|
When I set the following fields to these values in the app:
|
||||||
|
| Username | student1 |
|
||||||
|
| Password | student1 |
|
||||||
|
And I press "Log in" near "Lost password?" in the app
|
||||||
|
Then the header should be "Acceptance test site" in the app
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 51 KiB |
Loading…
Reference in New Issue