From e93ff1b1fb3e58c0f1f684084f9f932f714d9948 Mon Sep 17 00:00:00 2001 From: Eduardo Robles Elvira Date: Fri, 28 Jan 2022 16:05:56 +0100 Subject: [PATCH 1/5] Fine-grained selenium support also with user credentials --- agora-gui/self_testing.yml | 19 ++++++++--- agora-gui/templates/launch_selftest.sh | 9 ++++++ agora-gui/templates/selenium.conf | 2 +- agora-gui/templates/selenium.sh | 2 +- authapi/install.yml | 19 +++++++++++ authapi/templates/e2e_test_user.json | 3 ++ authapi/templates/sudo-run-selftests | 2 ++ authapi/user.yml | 1 - config.yml | 44 +++++++++++++++++++++---- doc/devel/agora.config.yml | 40 +++++++++++++++++++++++ doc/devel/auth1.config.yml | 40 +++++++++++++++++++++++ doc/devel/auth2.config.yml | 45 ++++++++++++++++++++++---- doc/production/config.auth.yml | 45 ++++++++++++++++++++++---- doc/production/config.master.yml | 45 ++++++++++++++++++++++---- 14 files changed, 284 insertions(+), 32 deletions(-) create mode 100644 authapi/templates/e2e_test_user.json diff --git a/agora-gui/self_testing.yml b/agora-gui/self_testing.yml index 30ce9d82..7044cc65 100644 --- a/agora-gui/self_testing.yml +++ b/agora-gui/self_testing.yml @@ -15,14 +15,14 @@ --- - name: AgoraGui, Add Apt signing key for google-chrome - when: config.agora_gui.enable_self_testing + when: config.agora_gui.self_testing.enable become: true ansible.builtin.apt_key: url: "https://dl.google.com/linux/linux_signing_key.pub" state: present - name: AgoraGui, Add google-chrome repository into sources list - when: config.agora_gui.enable_self_testing + when: config.agora_gui.self_testing.enable become: true ansible.builtin.apt_repository: repo: deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main @@ -30,6 +30,7 @@ filename: google-chrome - name: AgoraGui, Install google-chrome + when: config.agora_gui.self_testing.enable become: true ansible.builtin.apt: name: google-chrome-stable @@ -45,13 +46,20 @@ group: agoragui mode: '0744' -- name: AgoraGui, set e2e tests baseUrl setting +- name: AgoraGui, set e2e tests settings become: true become_user: agoragui replace: dest: /home/agoragui/agora-gui-admin/test/e2e.conf.js - regexp: 'baseUrl:.*' - replace: 'baseUrl: "https://{{config.agora_gui.domain}}"' + regexp: '{{ item.regexp }}' + replace: '{{ item.replace }}' + with_items: + - regexp: 'defaultTimeoutInterval:.*' + replace: 'defaultTimeoutInterval: {{authapi.self_testing.defaultTimeoutInterval}},' + - regexp: 'getPageTimeout:.*' + replace: 'getPageTimeout: {{authapi.self_testing.getPageTimeout}},' + - regexp: 'allScriptsTimeout:.*' + replace: 'allScriptsTimeout: {{authapi.self_testing.allScriptsTimeout}},' - name: AgoraGui, Creating selenium service become: true @@ -78,6 +86,7 @@ mode: '0700' - name: AgoraGui, updating web-driver + when: config.agora_gui.self_testing.enable become: true become_user: agoragui ansible.builtin.shell: diff --git a/agora-gui/templates/launch_selftest.sh b/agora-gui/templates/launch_selftest.sh index 43084c07..5d92aa66 100644 --- a/agora-gui/templates/launch_selftest.sh +++ b/agora-gui/templates/launch_selftest.sh @@ -16,4 +16,13 @@ # along with agora-dev-box. If not, see . cd /home/agoragui/agora-gui-admin +export PROTRACTOR_ARGS=$(cat <<-JSON_END + { + "baseUrl": "https://{{config.agora_gui.domain}}", + "params": { + "login": {{authapi.self_testing.admin_user_credentials}} + } + } +JSON_END +) grunt protractor diff --git a/agora-gui/templates/selenium.conf b/agora-gui/templates/selenium.conf index 3e2ceab8..0a43859b 100644 --- a/agora-gui/templates/selenium.conf +++ b/agora-gui/templates/selenium.conf @@ -1,7 +1,7 @@ [program:selenium] command=/home/agoragui/selenium.sh directory=/home/agoragui/ -autostart={% if config.agora_gui.enable_self_testing %}true +autostart={% if config.agora_gui.self_testing.enable %}true {% else %}false {% endif %} autorestart=true diff --git a/agora-gui/templates/selenium.sh b/agora-gui/templates/selenium.sh index cc19a4ed..cbc7c629 100644 --- a/agora-gui/templates/selenium.sh +++ b/agora-gui/templates/selenium.sh @@ -16,7 +16,7 @@ export DRIVER_PATH=/home/agoragui/agora-gui-admin/node_modules/webdriver-manager -${DRIVER_PATH}/bin/webdriver-manager update +${DRIVER_PATH}/bin/webdriver-manager update --ignore_ssl ${DRIVER_PATH}/bin/webdriver-manager \ start \ diff --git a/authapi/install.yml b/authapi/install.yml index b6acd3ad..242343d1 100644 --- a/authapi/install.yml +++ b/authapi/install.yml @@ -129,6 +129,25 @@ virtualenv: /home/authapi/env settings: authapi.deploy +- name: Authapi, create e2e_test_user file + become: true + template: + src: authapi/templates/e2e_test_user.json + dest: /home/authapi/e2e_test_user.json + owner: authapi + group: authapi + mode: '0600' + +- name: AuthApi, upsert e2e_test_user + become: true + become_user: authapi + django_manage: + command: upsert_users /home/authapi/e2e_test_user.json + args: + app_path: /home/authapi/authapi/authapi + virtualenv: /home/authapi/env + settings: authapi.deploy + - name: Authapi, allow authapi user to create databases (for example the test db) become: true become_user: postgres diff --git a/authapi/templates/e2e_test_user.json b/authapi/templates/e2e_test_user.json new file mode 100644 index 00000000..137f4d70 --- /dev/null +++ b/authapi/templates/e2e_test_user.json @@ -0,0 +1,3 @@ +[ + {{config.agora_gui.self_testing.admin_user_credentials}} +] \ No newline at end of file diff --git a/authapi/templates/sudo-run-selftests b/authapi/templates/sudo-run-selftests index 42863f03..679b0b9e 100644 --- a/authapi/templates/sudo-run-selftests +++ b/authapi/templates/sudo-run-selftests @@ -1,2 +1,4 @@ +{% if config.agora_gui.self_testing.enable %} authapi ALL = (agoragui) NOPASSWD: /home/agoragui/launch_selftest.sh authapi ALL = (root) NOPASSWD: /home/agoragui/kill_selftest.sh +{% endif %} \ No newline at end of file diff --git a/authapi/user.yml b/authapi/user.yml index 0c4ffa4d..0d79170d 100644 --- a/authapi/user.yml +++ b/authapi/user.yml @@ -32,7 +32,6 @@ - name: AuthApi, add sudoers file to be able to launch self-tests become: true - when: config.agora_gui.enable_self_testing template: src: authapi/templates/sudo-run-selftests dest: /etc/sudoers.d/sudo-run-selftests diff --git a/config.yml b/config.yml index f983bdf6..6695ab98 100644 --- a/config.yml +++ b/config.yml @@ -497,12 +497,44 @@ config: booth_port: 10091 elections_port: 10092 - # Boolean (default: true) that, if set to true, allows admins to launch - # a suite of automated end-to-end tests that follow the whole process of - # an election, including registering, creating the election keys, starting - # the election, voting, stopping, tallying, calculating and publishing the - # election results. - enable_self_testing: true + self_testing: + # Boolean (default: true) that, if set to true, allows admins to launch + # a suite of automated end-to-end tests that follow the whole process of + # an election, including registering, creating the election keys, starting + # the election, voting, stopping, tallying, calculating and publishing the + # election results. + enable: true + + # credentials used for the admin user in the self tests. This user will be + # automatically created and managed by the ansible script. The format of + # this data is the same as the elements accepted by authapi's admin + # command `upsert_users`. + # More Info: https://github.com/agoravoting/authapi/blob/master/authapi/api/management/commands/upsert_users.py#L21 + admin_user_credentials: | + { + "username": "e2e_test_admin", + "email": "e2e_test_admin@example.com", + "password": "", + "is_active": true, + "is_admin": true, + "election_permissions": [] + } + + # Number (Miliseconds, default: 120000) Default time to wait before a test + # fails. + # More Info: https://github.com/angular/protractor/blob/master/lib/config.ts#L629 + defaultTimeoutInterval: 120000 + + # Number (Miliseconds, default: 15000) How long to wait for a page to + # load. + # More Info: https://github.com/angular/protractor/blob/master/lib/config.ts#L446 + getPageTimeout: 15000 + + # Number (Miliseconds, default: 10000) The timeout in milliseconds for + # each script run on the browser. This should be longer than the maximum + # time your application needs to stabilize between tasks. + # More Info: https://github.com/angular/protractor/blob/master/lib/config.ts#L441 + allScriptsTimeout: 10000 # Main version shown in the user interface. set to 'false' if you don't # want it to be shown. diff --git a/doc/devel/agora.config.yml b/doc/devel/agora.config.yml index 2e8494b2..73a3db11 100644 --- a/doc/devel/agora.config.yml +++ b/doc/devel/agora.config.yml @@ -496,6 +496,46 @@ config: booth_port: 10091 elections_port: 10092 + self_testing: + # Boolean (default: true) that, if set to true, allows admins to launch + # a suite of automated end-to-end tests that follow the whole process of + # an election, including registering, creating the election keys, starting + # the election, voting, stopping, tallying, calculating and publishing the + # election results. + enable: true + + # credentials used for the admin user in the self tests. This user will be + # automatically created and managed by the ansible script. The format of + # this data is the same as the elements accepted by authapi's admin + # command `upsert_users`. + # More Info: https://github.com/agoravoting/authapi/blob/master/authapi/api/management/commands/upsert_users.py#L21 + admin_user_credentials: | + { + "username": "e2e_test_admin", + "email": "e2e_test_admin@example.com", + "password": "", + "is_active": true, + "is_admin": true, + "election_permissions": [] + } + + # Number (Miliseconds, default: 120000) Default time to wait before a test + # fails. + # More Info: https://github.com/angular/protractor/blob/master/lib/config.ts#L629 + defaultTimeoutInterval: 120000 + + # Number (Miliseconds, default: 15000) How long to wait for a page to + # load. + # More Info: https://github.com/angular/protractor/blob/master/lib/config.ts#L446 + getPageTimeout: 15000 + + # Number (Miliseconds, default: 10000) The timeout in milliseconds for + # each script run on the browser. This should be longer than the maximum + # time your application needs to stabilize between tasks. + # More Info: https://github.com/angular/protractor/blob/master/lib/config.ts#L441 + allScriptsTimeout: 10000 + + # Main version shown in the user interface. set to 'false' if you don't # want it to be shown. mainVersion: 'master' diff --git a/doc/devel/auth1.config.yml b/doc/devel/auth1.config.yml index c205225f..4dd0830d 100644 --- a/doc/devel/auth1.config.yml +++ b/doc/devel/auth1.config.yml @@ -496,6 +496,46 @@ config: booth_port: 10091 elections_port: 10092 + self_testing: + # Boolean (default: true) that, if set to true, allows admins to launch + # a suite of automated end-to-end tests that follow the whole process of + # an election, including registering, creating the election keys, starting + # the election, voting, stopping, tallying, calculating and publishing the + # election results. + enable: true + + # credentials used for the admin user in the self tests. This user will be + # automatically created and managed by the ansible script. The format of + # this data is the same as the elements accepted by authapi's admin + # command `upsert_users`. + # More Info: https://github.com/agoravoting/authapi/blob/master/authapi/api/management/commands/upsert_users.py#L21 + admin_user_credentials: | + { + "username": "e2e_test_admin", + "email": "e2e_test_admin@example.com", + "password": "", + "is_active": true, + "is_admin": true, + "election_permissions": [] + } + + # Number (Miliseconds, default: 120000) Default time to wait before a test + # fails. + # More Info: https://github.com/angular/protractor/blob/master/lib/config.ts#L629 + defaultTimeoutInterval: 120000 + + # Number (Miliseconds, default: 15000) How long to wait for a page to + # load. + # More Info: https://github.com/angular/protractor/blob/master/lib/config.ts#L446 + getPageTimeout: 15000 + + # Number (Miliseconds, default: 10000) The timeout in milliseconds for + # each script run on the browser. This should be longer than the maximum + # time your application needs to stabilize between tasks. + # More Info: https://github.com/angular/protractor/blob/master/lib/config.ts#L441 + allScriptsTimeout: 10000 + + # Main version shown in the user interface. set to 'false' if you don't # want it to be shown. mainVersion: 'master' diff --git a/doc/devel/auth2.config.yml b/doc/devel/auth2.config.yml index b2b4389b..81af8cdc 100644 --- a/doc/devel/auth2.config.yml +++ b/doc/devel/auth2.config.yml @@ -496,12 +496,45 @@ config: booth_port: 10091 elections_port: 10092 - # Boolean (default: true) that, if set to true, allows admins to launch - # a suite of automated end-to-end tests that follow the whole process of - # an election, including registering, creating the election keys, starting - # the election, voting, stopping, tallying, calculating and publishing the - # election results. - enable_self_testing: true + self_testing: + # Boolean (default: true) that, if set to true, allows admins to launch + # a suite of automated end-to-end tests that follow the whole process of + # an election, including registering, creating the election keys, starting + # the election, voting, stopping, tallying, calculating and publishing the + # election results. + enable: true + + # credentials used for the admin user in the self tests. This user will be + # automatically created and managed by the ansible script. The format of + # this data is the same as the elements accepted by authapi's admin + # command `upsert_users`. + # More Info: https://github.com/agoravoting/authapi/blob/master/authapi/api/management/commands/upsert_users.py#L21 + admin_user_credentials: | + { + "username": "e2e_test_admin", + "email": "e2e_test_admin@example.com", + "password": "", + "is_active": true, + "is_admin": true, + "election_permissions": [] + } + + # Number (Miliseconds, default: 120000) Default time to wait before a test + # fails. + # More Info: https://github.com/angular/protractor/blob/master/lib/config.ts#L629 + defaultTimeoutInterval: 120000 + + # Number (Miliseconds, default: 15000) How long to wait for a page to + # load. + # More Info: https://github.com/angular/protractor/blob/master/lib/config.ts#L446 + getPageTimeout: 15000 + + # Number (Miliseconds, default: 10000) The timeout in milliseconds for + # each script run on the browser. This should be longer than the maximum + # time your application needs to stabilize between tasks. + # More Info: https://github.com/angular/protractor/blob/master/lib/config.ts#L441 + allScriptsTimeout: 10000 + # Main version shown in the user interface. set to 'false' if you don't # want it to be shown. diff --git a/doc/production/config.auth.yml b/doc/production/config.auth.yml index b646dce9..fa326485 100644 --- a/doc/production/config.auth.yml +++ b/doc/production/config.auth.yml @@ -496,12 +496,45 @@ config: booth_port: 10091 elections_port: 10092 - # Boolean (default: true) that, if set to true, allows admins to launch - # a suite of automated end-to-end tests that follow the whole process of - # an election, including registering, creating the election keys, starting - # the election, voting, stopping, tallying, calculating and publishing the - # election results. - enable_self_testing: true + self_testing: + # Boolean (default: true) that, if set to true, allows admins to launch + # a suite of automated end-to-end tests that follow the whole process of + # an election, including registering, creating the election keys, starting + # the election, voting, stopping, tallying, calculating and publishing the + # election results. + enable: true + + # credentials used for the admin user in the self tests. This user will be + # automatically created and managed by the ansible script. The format of + # this data is the same as the elements accepted by authapi's admin + # command `upsert_users`. + # More Info: https://github.com/agoravoting/authapi/blob/master/authapi/api/management/commands/upsert_users.py#L21 + admin_user_credentials: | + { + "username": "e2e_test_admin", + "email": "e2e_test_admin@example.com", + "password": "", + "is_active": true, + "is_admin": true, + "election_permissions": [] + } + + # Number (Miliseconds, default: 120000) Default time to wait before a test + # fails. + # More Info: https://github.com/angular/protractor/blob/master/lib/config.ts#L629 + defaultTimeoutInterval: 120000 + + # Number (Miliseconds, default: 15000) How long to wait for a page to + # load. + # More Info: https://github.com/angular/protractor/blob/master/lib/config.ts#L446 + getPageTimeout: 15000 + + # Number (Miliseconds, default: 10000) The timeout in milliseconds for + # each script run on the browser. This should be longer than the maximum + # time your application needs to stabilize between tasks. + # More Info: https://github.com/angular/protractor/blob/master/lib/config.ts#L441 + allScriptsTimeout: 10000 + # Main version shown in the user interface. set to 'false' if you don't # want it to be shown. diff --git a/doc/production/config.master.yml b/doc/production/config.master.yml index 2f731649..a17b9383 100644 --- a/doc/production/config.master.yml +++ b/doc/production/config.master.yml @@ -496,12 +496,45 @@ config: booth_port: 10091 elections_port: 10092 - # Boolean (default: true) that, if set to true, allows admins to launch - # a suite of automated end-to-end tests that follow the whole process of - # an election, including registering, creating the election keys, starting - # the election, voting, stopping, tallying, calculating and publishing the - # election results. - enable_self_testing: true + self_testing: + # Boolean (default: true) that, if set to true, allows admins to launch + # a suite of automated end-to-end tests that follow the whole process of + # an election, including registering, creating the election keys, starting + # the election, voting, stopping, tallying, calculating and publishing the + # election results. + enable: true + + # credentials used for the admin user in the self tests. This user will be + # automatically created and managed by the ansible script. The format of + # this data is the same as the elements accepted by authapi's admin + # command `upsert_users`. + # More Info: https://github.com/agoravoting/authapi/blob/master/authapi/api/management/commands/upsert_users.py#L21 + admin_user_credentials: | + { + "username": "e2e_test_admin", + "email": "e2e_test_admin@example.com", + "password": "", + "is_active": true, + "is_admin": true, + "election_permissions": [] + } + + # Number (Miliseconds, default: 120000) Default time to wait before a test + # fails. + # More Info: https://github.com/angular/protractor/blob/master/lib/config.ts#L629 + defaultTimeoutInterval: 120000 + + # Number (Miliseconds, default: 15000) How long to wait for a page to + # load. + # More Info: https://github.com/angular/protractor/blob/master/lib/config.ts#L446 + getPageTimeout: 15000 + + # Number (Miliseconds, default: 10000) The timeout in milliseconds for + # each script run on the browser. This should be longer than the maximum + # time your application needs to stabilize between tasks. + # More Info: https://github.com/angular/protractor/blob/master/lib/config.ts#L441 + allScriptsTimeout: 10000 + # Main version shown in the user interface. set to 'false' if you don't # want it to be shown. From e131a33ef4fb92605ed0d01b29c3220bdfdf2d7d Mon Sep 17 00:00:00 2001 From: Eduardo Robles Elvira Date: Fri, 28 Jan 2022 16:41:30 +0100 Subject: [PATCH 2/5] fix some var refs --- agora-gui/self_testing.yml | 6 +++--- agora-gui/templates/launch_selftest.sh | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/agora-gui/self_testing.yml b/agora-gui/self_testing.yml index 7044cc65..072f332d 100644 --- a/agora-gui/self_testing.yml +++ b/agora-gui/self_testing.yml @@ -55,11 +55,11 @@ replace: '{{ item.replace }}' with_items: - regexp: 'defaultTimeoutInterval:.*' - replace: 'defaultTimeoutInterval: {{authapi.self_testing.defaultTimeoutInterval}},' + replace: 'defaultTimeoutInterval: {{config.agora_gui.self_testing.defaultTimeoutInterval}},' - regexp: 'getPageTimeout:.*' - replace: 'getPageTimeout: {{authapi.self_testing.getPageTimeout}},' + replace: 'getPageTimeout: {{config.agora_gui.self_testing.getPageTimeout}},' - regexp: 'allScriptsTimeout:.*' - replace: 'allScriptsTimeout: {{authapi.self_testing.allScriptsTimeout}},' + replace: 'allScriptsTimeout: {{config.agora_gui.self_testing.allScriptsTimeout}},' - name: AgoraGui, Creating selenium service become: true diff --git a/agora-gui/templates/launch_selftest.sh b/agora-gui/templates/launch_selftest.sh index 5d92aa66..91d72757 100644 --- a/agora-gui/templates/launch_selftest.sh +++ b/agora-gui/templates/launch_selftest.sh @@ -20,7 +20,7 @@ export PROTRACTOR_ARGS=$(cat <<-JSON_END { "baseUrl": "https://{{config.agora_gui.domain}}", "params": { - "login": {{authapi.self_testing.admin_user_credentials}} + "login": {{config.agora_gui.self_testing.admin_user_credentials}} } } JSON_END From 9493e9af1c6700ed3dcb90831bfd43cbd760c8f9 Mon Sep 17 00:00:00 2001 From: Eduardo Robles Elvira Date: Sun, 30 Jan 2022 16:42:26 +0100 Subject: [PATCH 3/5] standarizing browser.wait timeout --- agora-gui/templates/launch_selftest.sh | 5 ++++- config.yml | 7 ++++++- doc/devel/agora.config.yml | 8 ++++++-- doc/devel/auth1.config.yml | 8 ++++++-- doc/devel/auth2.config.yml | 8 ++++++-- doc/production/config.auth.yml | 8 ++++++-- doc/production/config.master.yml | 8 ++++++-- 7 files changed, 40 insertions(+), 12 deletions(-) diff --git a/agora-gui/templates/launch_selftest.sh b/agora-gui/templates/launch_selftest.sh index 91d72757..bb94525a 100644 --- a/agora-gui/templates/launch_selftest.sh +++ b/agora-gui/templates/launch_selftest.sh @@ -20,7 +20,10 @@ export PROTRACTOR_ARGS=$(cat <<-JSON_END { "baseUrl": "https://{{config.agora_gui.domain}}", "params": { - "login": {{config.agora_gui.self_testing.admin_user_credentials}} + "login": {{config.agora_gui.self_testing.admin_user_credentials}}, + "timeout" { + "ECstandards": {{config.agora_gui.self_testing.allScriptsTimeout}} + } } } JSON_END diff --git a/config.yml b/config.yml index 6695ab98..91699ede 100644 --- a/config.yml +++ b/config.yml @@ -533,7 +533,12 @@ config: # Number (Miliseconds, default: 10000) The timeout in milliseconds for # each script run on the browser. This should be longer than the maximum # time your application needs to stabilize between tasks. - # More Info: https://github.com/angular/protractor/blob/master/lib/config.ts#L441 + # + # Also used as the default timeout in protractor browser.wait calls. + # + # More Info: + # 1. https://github.com/angular/protractor/blob/master/lib/config.ts#L441 + # 2. http://www.protractortest.org/#/api?view=webdriver.WebDriver.prototype.wait allScriptsTimeout: 10000 # Main version shown in the user interface. set to 'false' if you don't diff --git a/doc/devel/agora.config.yml b/doc/devel/agora.config.yml index 73a3db11..94227053 100644 --- a/doc/devel/agora.config.yml +++ b/doc/devel/agora.config.yml @@ -532,10 +532,14 @@ config: # Number (Miliseconds, default: 10000) The timeout in milliseconds for # each script run on the browser. This should be longer than the maximum # time your application needs to stabilize between tasks. - # More Info: https://github.com/angular/protractor/blob/master/lib/config.ts#L441 + # + # Also used as the default timeout in protractor browser.wait calls. + # + # More Info: + # 1. https://github.com/angular/protractor/blob/master/lib/config.ts#L441 + # 2. http://www.protractortest.org/#/api?view=webdriver.WebDriver.prototype.wait allScriptsTimeout: 10000 - # Main version shown in the user interface. set to 'false' if you don't # want it to be shown. mainVersion: 'master' diff --git a/doc/devel/auth1.config.yml b/doc/devel/auth1.config.yml index 4dd0830d..3a868334 100644 --- a/doc/devel/auth1.config.yml +++ b/doc/devel/auth1.config.yml @@ -532,10 +532,14 @@ config: # Number (Miliseconds, default: 10000) The timeout in milliseconds for # each script run on the browser. This should be longer than the maximum # time your application needs to stabilize between tasks. - # More Info: https://github.com/angular/protractor/blob/master/lib/config.ts#L441 + # + # Also used as the default timeout in protractor browser.wait calls. + # + # More Info: + # 1. https://github.com/angular/protractor/blob/master/lib/config.ts#L441 + # 2. http://www.protractortest.org/#/api?view=webdriver.WebDriver.prototype.wait allScriptsTimeout: 10000 - # Main version shown in the user interface. set to 'false' if you don't # want it to be shown. mainVersion: 'master' diff --git a/doc/devel/auth2.config.yml b/doc/devel/auth2.config.yml index 81af8cdc..02b30adc 100644 --- a/doc/devel/auth2.config.yml +++ b/doc/devel/auth2.config.yml @@ -532,10 +532,14 @@ config: # Number (Miliseconds, default: 10000) The timeout in milliseconds for # each script run on the browser. This should be longer than the maximum # time your application needs to stabilize between tasks. - # More Info: https://github.com/angular/protractor/blob/master/lib/config.ts#L441 + # + # Also used as the default timeout in protractor browser.wait calls. + # + # More Info: + # 1. https://github.com/angular/protractor/blob/master/lib/config.ts#L441 + # 2. http://www.protractortest.org/#/api?view=webdriver.WebDriver.prototype.wait allScriptsTimeout: 10000 - # Main version shown in the user interface. set to 'false' if you don't # want it to be shown. mainVersion: 'master' diff --git a/doc/production/config.auth.yml b/doc/production/config.auth.yml index fa326485..620c374b 100644 --- a/doc/production/config.auth.yml +++ b/doc/production/config.auth.yml @@ -532,10 +532,14 @@ config: # Number (Miliseconds, default: 10000) The timeout in milliseconds for # each script run on the browser. This should be longer than the maximum # time your application needs to stabilize between tasks. - # More Info: https://github.com/angular/protractor/blob/master/lib/config.ts#L441 + # + # Also used as the default timeout in protractor browser.wait calls. + # + # More Info: + # 1. https://github.com/angular/protractor/blob/master/lib/config.ts#L441 + # 2. http://www.protractortest.org/#/api?view=webdriver.WebDriver.prototype.wait allScriptsTimeout: 10000 - # Main version shown in the user interface. set to 'false' if you don't # want it to be shown. mainVersion: 'master' diff --git a/doc/production/config.master.yml b/doc/production/config.master.yml index a17b9383..fad06564 100644 --- a/doc/production/config.master.yml +++ b/doc/production/config.master.yml @@ -532,10 +532,14 @@ config: # Number (Miliseconds, default: 10000) The timeout in milliseconds for # each script run on the browser. This should be longer than the maximum # time your application needs to stabilize between tasks. - # More Info: https://github.com/angular/protractor/blob/master/lib/config.ts#L441 + # + # Also used as the default timeout in protractor browser.wait calls. + # + # More Info: + # 1. https://github.com/angular/protractor/blob/master/lib/config.ts#L441 + # 2. http://www.protractortest.org/#/api?view=webdriver.WebDriver.prototype.wait allScriptsTimeout: 10000 - # Main version shown in the user interface. set to 'false' if you don't # want it to be shown. mainVersion: 'master' From dde237de4d0305e3e4f3255f359c8956ef2b76b5 Mon Sep 17 00:00:00 2001 From: Eduardo Robles Elvira Date: Sun, 30 Jan 2022 17:03:40 +0100 Subject: [PATCH 4/5] fix typo --- agora-gui/templates/launch_selftest.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agora-gui/templates/launch_selftest.sh b/agora-gui/templates/launch_selftest.sh index bb94525a..ef5070e0 100644 --- a/agora-gui/templates/launch_selftest.sh +++ b/agora-gui/templates/launch_selftest.sh @@ -21,7 +21,7 @@ export PROTRACTOR_ARGS=$(cat <<-JSON_END "baseUrl": "https://{{config.agora_gui.domain}}", "params": { "login": {{config.agora_gui.self_testing.admin_user_credentials}}, - "timeout" { + "timeout": { "ECstandards": {{config.agora_gui.self_testing.allScriptsTimeout}} } } From 66fc148acdad59da40c3b32b6dacaf913d8afc3d Mon Sep 17 00:00:00 2001 From: Eduardo Robles Elvira Date: Mon, 31 Jan 2022 10:15:38 +0100 Subject: [PATCH 5/5] adding specific timeout for election creation --- agora-gui/templates/launch_selftest.sh | 3 ++- config.yml | 12 +++++++++--- doc/devel/agora.config.yml | 12 +++++++++--- doc/devel/auth1.config.yml | 12 +++++++++--- doc/devel/auth2.config.yml | 12 +++++++++--- doc/production/config.auth.yml | 12 +++++++++--- doc/production/config.master.yml | 12 +++++++++--- 7 files changed, 56 insertions(+), 19 deletions(-) diff --git a/agora-gui/templates/launch_selftest.sh b/agora-gui/templates/launch_selftest.sh index ef5070e0..adbf9b89 100644 --- a/agora-gui/templates/launch_selftest.sh +++ b/agora-gui/templates/launch_selftest.sh @@ -22,7 +22,8 @@ export PROTRACTOR_ARGS=$(cat <<-JSON_END "params": { "login": {{config.agora_gui.self_testing.admin_user_credentials}}, "timeout": { - "ECstandards": {{config.agora_gui.self_testing.allScriptsTimeout}} + "ECstandards": {{config.agora_gui.self_testing.allScriptsTimeout}}, + "CreateElections": {{config.agora_gui.self_testing.createElectionsTimeout}} } } } diff --git a/config.yml b/config.yml index 91699ede..dd70edd0 100644 --- a/config.yml +++ b/config.yml @@ -520,17 +520,17 @@ config: "election_permissions": [] } - # Number (Miliseconds, default: 120000) Default time to wait before a test + # Number (Miliseconds, default: 120,000) Default time to wait before a test # fails. # More Info: https://github.com/angular/protractor/blob/master/lib/config.ts#L629 defaultTimeoutInterval: 120000 - # Number (Miliseconds, default: 15000) How long to wait for a page to + # Number (Miliseconds, default: 15,000) How long to wait for a page to # load. # More Info: https://github.com/angular/protractor/blob/master/lib/config.ts#L446 getPageTimeout: 15000 - # Number (Miliseconds, default: 10000) The timeout in milliseconds for + # Number (Miliseconds, default: 10,000) The timeout in milliseconds for # each script run on the browser. This should be longer than the maximum # time your application needs to stabilize between tasks. # @@ -541,6 +541,12 @@ config: # 2. http://www.protractortest.org/#/api?view=webdriver.WebDriver.prototype.wait allScriptsTimeout: 10000 + # Timeout (Miliseconds, default: 120,000) for creating elections during + # the tests. Each election takes ~30 seconds/question to create with 2 + # authorities. Sometimes test might include the creation of multiple + # elections with multiple questions, so change this accordingly. + createElectionsTimeout: 120000 + # Main version shown in the user interface. set to 'false' if you don't # want it to be shown. mainVersion: 'master' diff --git a/doc/devel/agora.config.yml b/doc/devel/agora.config.yml index 94227053..4215be16 100644 --- a/doc/devel/agora.config.yml +++ b/doc/devel/agora.config.yml @@ -519,17 +519,17 @@ config: "election_permissions": [] } - # Number (Miliseconds, default: 120000) Default time to wait before a test + # Number (Miliseconds, default: 120,000) Default time to wait before a test # fails. # More Info: https://github.com/angular/protractor/blob/master/lib/config.ts#L629 defaultTimeoutInterval: 120000 - # Number (Miliseconds, default: 15000) How long to wait for a page to + # Number (Miliseconds, default: 15,000) How long to wait for a page to # load. # More Info: https://github.com/angular/protractor/blob/master/lib/config.ts#L446 getPageTimeout: 15000 - # Number (Miliseconds, default: 10000) The timeout in milliseconds for + # Number (Miliseconds, default: 10,000) The timeout in milliseconds for # each script run on the browser. This should be longer than the maximum # time your application needs to stabilize between tasks. # @@ -540,6 +540,12 @@ config: # 2. http://www.protractortest.org/#/api?view=webdriver.WebDriver.prototype.wait allScriptsTimeout: 10000 + # Timeout (Miliseconds, default: 120,000) for creating elections during + # the tests. Each election takes ~30 seconds/question to create with 2 + # authorities. Sometimes test might include the creation of multiple + # elections with multiple questions, so change this accordingly. + createElectionsTimeout: 120000 + # Main version shown in the user interface. set to 'false' if you don't # want it to be shown. mainVersion: 'master' diff --git a/doc/devel/auth1.config.yml b/doc/devel/auth1.config.yml index 3a868334..d2f4b418 100644 --- a/doc/devel/auth1.config.yml +++ b/doc/devel/auth1.config.yml @@ -519,17 +519,17 @@ config: "election_permissions": [] } - # Number (Miliseconds, default: 120000) Default time to wait before a test + # Number (Miliseconds, default: 120,000) Default time to wait before a test # fails. # More Info: https://github.com/angular/protractor/blob/master/lib/config.ts#L629 defaultTimeoutInterval: 120000 - # Number (Miliseconds, default: 15000) How long to wait for a page to + # Number (Miliseconds, default: 15,000) How long to wait for a page to # load. # More Info: https://github.com/angular/protractor/blob/master/lib/config.ts#L446 getPageTimeout: 15000 - # Number (Miliseconds, default: 10000) The timeout in milliseconds for + # Number (Miliseconds, default: 10,000) The timeout in milliseconds for # each script run on the browser. This should be longer than the maximum # time your application needs to stabilize between tasks. # @@ -540,6 +540,12 @@ config: # 2. http://www.protractortest.org/#/api?view=webdriver.WebDriver.prototype.wait allScriptsTimeout: 10000 + # Timeout (Miliseconds, default: 120,000) for creating elections during + # the tests. Each election takes ~30 seconds/question to create with 2 + # authorities. Sometimes test might include the creation of multiple + # elections with multiple questions, so change this accordingly. + createElectionsTimeout: 120000 + # Main version shown in the user interface. set to 'false' if you don't # want it to be shown. mainVersion: 'master' diff --git a/doc/devel/auth2.config.yml b/doc/devel/auth2.config.yml index 02b30adc..ff0c7c18 100644 --- a/doc/devel/auth2.config.yml +++ b/doc/devel/auth2.config.yml @@ -519,17 +519,17 @@ config: "election_permissions": [] } - # Number (Miliseconds, default: 120000) Default time to wait before a test + # Number (Miliseconds, default: 120,000) Default time to wait before a test # fails. # More Info: https://github.com/angular/protractor/blob/master/lib/config.ts#L629 defaultTimeoutInterval: 120000 - # Number (Miliseconds, default: 15000) How long to wait for a page to + # Number (Miliseconds, default: 15,000) How long to wait for a page to # load. # More Info: https://github.com/angular/protractor/blob/master/lib/config.ts#L446 getPageTimeout: 15000 - # Number (Miliseconds, default: 10000) The timeout in milliseconds for + # Number (Miliseconds, default: 10,000) The timeout in milliseconds for # each script run on the browser. This should be longer than the maximum # time your application needs to stabilize between tasks. # @@ -540,6 +540,12 @@ config: # 2. http://www.protractortest.org/#/api?view=webdriver.WebDriver.prototype.wait allScriptsTimeout: 10000 + # Timeout (Miliseconds, default: 120,000) for creating elections during + # the tests. Each election takes ~30 seconds/question to create with 2 + # authorities. Sometimes test might include the creation of multiple + # elections with multiple questions, so change this accordingly. + createElectionsTimeout: 120000 + # Main version shown in the user interface. set to 'false' if you don't # want it to be shown. mainVersion: 'master' diff --git a/doc/production/config.auth.yml b/doc/production/config.auth.yml index 620c374b..766872e6 100644 --- a/doc/production/config.auth.yml +++ b/doc/production/config.auth.yml @@ -519,17 +519,17 @@ config: "election_permissions": [] } - # Number (Miliseconds, default: 120000) Default time to wait before a test + # Number (Miliseconds, default: 120,000) Default time to wait before a test # fails. # More Info: https://github.com/angular/protractor/blob/master/lib/config.ts#L629 defaultTimeoutInterval: 120000 - # Number (Miliseconds, default: 15000) How long to wait for a page to + # Number (Miliseconds, default: 15,000) How long to wait for a page to # load. # More Info: https://github.com/angular/protractor/blob/master/lib/config.ts#L446 getPageTimeout: 15000 - # Number (Miliseconds, default: 10000) The timeout in milliseconds for + # Number (Miliseconds, default: 10,000) The timeout in milliseconds for # each script run on the browser. This should be longer than the maximum # time your application needs to stabilize between tasks. # @@ -540,6 +540,12 @@ config: # 2. http://www.protractortest.org/#/api?view=webdriver.WebDriver.prototype.wait allScriptsTimeout: 10000 + # Timeout (Miliseconds, default: 120,000) for creating elections during + # the tests. Each election takes ~30 seconds/question to create with 2 + # authorities. Sometimes test might include the creation of multiple + # elections with multiple questions, so change this accordingly. + createElectionsTimeout: 120000 + # Main version shown in the user interface. set to 'false' if you don't # want it to be shown. mainVersion: 'master' diff --git a/doc/production/config.master.yml b/doc/production/config.master.yml index fad06564..78cba5d0 100644 --- a/doc/production/config.master.yml +++ b/doc/production/config.master.yml @@ -519,17 +519,17 @@ config: "election_permissions": [] } - # Number (Miliseconds, default: 120000) Default time to wait before a test + # Number (Miliseconds, default: 120,000) Default time to wait before a test # fails. # More Info: https://github.com/angular/protractor/blob/master/lib/config.ts#L629 defaultTimeoutInterval: 120000 - # Number (Miliseconds, default: 15000) How long to wait for a page to + # Number (Miliseconds, default: 15,000) How long to wait for a page to # load. # More Info: https://github.com/angular/protractor/blob/master/lib/config.ts#L446 getPageTimeout: 15000 - # Number (Miliseconds, default: 10000) The timeout in milliseconds for + # Number (Miliseconds, default: 10,000) The timeout in milliseconds for # each script run on the browser. This should be longer than the maximum # time your application needs to stabilize between tasks. # @@ -540,6 +540,12 @@ config: # 2. http://www.protractortest.org/#/api?view=webdriver.WebDriver.prototype.wait allScriptsTimeout: 10000 + # Timeout (Miliseconds, default: 120,000) for creating elections during + # the tests. Each election takes ~30 seconds/question to create with 2 + # authorities. Sometimes test might include the creation of multiple + # elections with multiple questions, so change this accordingly. + createElectionsTimeout: 120000 + # Main version shown in the user interface. set to 'false' if you don't # want it to be shown. mainVersion: 'master'