Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Titouan Soulard
erp5
Commits
ca87fa05
Commit
ca87fa05
authored
Nov 16, 2020
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_ui_test_core: Add login macro.
parent
f7727e02
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
0 deletions
+64
-0
bt5/erp5_ui_test_core/SkinTemplateItem/portal_skins/erp5_ui_test_core/Zuite_CommonTemplate.zpt
...m/portal_skins/erp5_ui_test_core/Zuite_CommonTemplate.zpt
+64
-0
No files found.
bt5/erp5_ui_test_core/SkinTemplateItem/portal_skins/erp5_ui_test_core/Zuite_CommonTemplate.zpt
View file @
ca87fa05
...
@@ -36,4 +36,68 @@
...
@@ -36,4 +36,68 @@
<tal:block tal:condition="here/portal_selections/isAnonymous"> (expected failure)</tal:block>
<tal:block tal:condition="here/portal_selections/isAnonymous"> (expected failure)</tal:block>
</tal:block>
</tal:block>
<!--
Environment variables:
- client_id (str, None)
String to use as OAuth2 client id. Default: None.
- login_form_url (str)
URL of the login form to open. Default: ${base_url}/login_form .
Must not contain a query nor a fragment).
- submit_name (str)
Name of the submit element to click to submit the form.
Hint: probably ends with ":method"
- username_field_name (str)
Name of the field the username should be typed in.
- password_field_name (str)
Name of the field the password should be typed in.
- wait (bool)
Whether to use click or clickAndWait to submit the login form.
True by default.
Macro slots:
- username
- password
-->
<tal:block metal:define-macro="login">
<tal:block tal:define="
wait wait | python: True;
client_id client_id | nothing;
login_form_url login_form_url | python: '${base_url}/login_form';
has_oauth2 python: getattr(context, 'ERP5Site_getOAuth2AuthorisationClientConnectorValue', lambda client_id: None)(client_id=client_id) is not None;
ERP5Site python: modules['Products.ERP5.ERP5Site'];
auto_username_field_name python: ERP5Site.ERP5_AUTHORISATION_EXTRACTOR_USERNAME_NAME if has_oauth2 else '__ac_name';
auto_password_field_name python: ERP5Site.ERP5_AUTHORISATION_EXTRACTOR_PASSWORD_NAME if has_oauth2 else '__ac_password';
username_field_name username_field_name | auto_username_field_name;
password_field_name password_field_name | auto_password_field_name;
">
<tal:block tal:condition="python: login_form_url is not None">
<tr>
<td>openAndWait</td>
<td tal:content="python: login_form_url + ('?client_id=' + client_id if client_id else '')"></td>
<td></td>
</tr>
<tr>
<td>waitForElementPresent</td>
<td tal:content="python: username_field_name"></td>
<td></td>
</tr>
</tal:block>
<tr>
<td>type</td>
<td tal:content="python: username_field_name"></td>
<td><tal:block metal:define-slot="username"/></td>
</tr>
<tr>
<td>type</td>
<td tal:content="python: password_field_name"></td>
<td><tal:block metal:define-slot="password"/></td>
</tr>
<tr>
<td tal:content="python: 'clickAndWait' if wait else 'click'"></td>
<td tal:content="submit_name | python: 'logged_in_once:method' if has_oauth2 else 'logged_in:method'"></td>
<td></td>
</tr>
</tal:block>
</tal:block>
</tal:block>
</tal:block>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment