Skip to content

Commit f3e109a

Browse files
authored
Merge pull request #4481 from dpalou/MOBILE-4653
Mobile 4653
2 parents 8b431d0 + ccd8b80 commit f3e109a

File tree

3 files changed

+40
-5
lines changed

3 files changed

+40
-5
lines changed

src/addons/mod/glossary/tests/behat/navigation.feature

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,11 @@ Feature: Test glossary navigation
146146
When I go back in the app
147147
And I scroll to "Acerola" in the app
148148
And I press "Search" in the app
149-
And I set the field "Search query" to "something" in the app
149+
And I set the field "Enter your search query" to "something" in the app
150150
And I press enter
151151
Then I should find "No entries were found." in the app
152152

153-
When I set the field "Search query" to "melon" in the app
153+
When I set the field "Enter your search query" to "melon" in the app
154154
And I press enter
155155
Then I should find "Honeydew Melon" in the app
156156
And I should find "Watermelon" in the app
@@ -265,11 +265,11 @@ Feature: Test glossary navigation
265265

266266
# Search
267267
When I press "Search" in the app
268-
And I set the field "Search query" to "something" in the app
268+
And I set the field "Enter your search query" to "something" in the app
269269
And I press enter
270270
Then I should find "No entries were found." in the app
271271

272-
When I set the field "Search query" to "melon" in the app
272+
When I set the field "Enter your search query" to "melon" in the app
273273
And I press enter
274274
Then I should find "Honeydew Melon" in the app
275275
And I should find "Watermelon" in the app

src/core/features/login/tests/behat/basic_usage.feature

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,3 +185,34 @@ Feature: Test basic usage of login in app
185185
| Password | student1 |
186186
And I press "Log in" near "Lost password?" in the app
187187
Then the header should be "Acceptance test site" in the app
188+
189+
Scenario: Exceeded login attempts
190+
Given the following config values are set as admin:
191+
| supportavailability | 2 |
192+
When I launch the app
193+
And I set the field "Your site" to "$WWWROOT" in the app
194+
And I press "Connect to your site" in the app
195+
And I set the following fields to these values in the app:
196+
| Username | wrong |
197+
| Password | credentials |
198+
And I press "Log in" near "Lost password?" in the app
199+
Then I should find "Invalid login" in the app
200+
201+
When I press "OK" in the app
202+
Then I should not find "Need help logging in?" in the app
203+
204+
When I press "Log in" near "Lost password?" in the app
205+
And I press "OK" in the app
206+
Then I should not find "Need help logging in?" in the app
207+
208+
When I press "Log in" near "Lost password?" in the app
209+
And I press "OK" in the app
210+
Then I should find "Need help logging in?" in the app
211+
212+
When I press "recovering your password" in the app
213+
Then I should find "Forgotten password" in the app
214+
And I should find "To reset your password" in the app
215+
216+
When I go back in the app
217+
And I press "Contact support" in the app
218+
Then the app should have opened a browser tab with url ".*\/user\/contactsitesupport\.php"

src/core/features/user/services/support.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import { AlertButton } from '@ionic/angular';
2525
import { CoreLang } from '@services/lang';
2626
import { CoreUserNullSupportConfig } from '@features/user/classes/support/null-support-config';
2727
import { CoreAlerts } from '@services/overlays/alerts';
28+
import { CoreOpener } from '@singletons/opener';
2829

2930
/**
3031
* Handle site support.
@@ -40,7 +41,10 @@ export class CoreUserSupportService {
4041
async contact(options: CoreUserSupportContactOptions = {}): Promise<void> {
4142
const supportConfig = options.supportConfig ?? CoreUserAuthenticatedSupportConfig.forCurrentSite();
4243
const supportPageUrl = supportConfig.getSupportPageUrl();
43-
const browser = await CoreSites.getCurrentSite()?.openInAppWithAutoLogin(supportPageUrl);
44+
const currentSite = CoreSites.getCurrentSite();
45+
const browser = await (currentSite ?
46+
currentSite.openInAppWithAutoLogin(supportPageUrl) :
47+
CoreOpener.openInApp(supportPageUrl));
4448

4549
if (browser && supportPageUrl.endsWith('/user/contactsitesupport.php')) {
4650
this.populateSupportForm(browser, options.subject, options.message);

0 commit comments

Comments
 (0)