Skip to content

Migrate to Selenium3 #1118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Sep 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ If you are programmer/sysadmin or you just feeling that you are able to run a lo
* *Validation*: JSR-303 (Hibernate Validator)
* *Logging*: Slf4j (Logback)
* *Unit tests*: Groovy and Spock Framework (for Java code), jasmine (for JavaScript code)
* *Integration tests*: Selenium2, RobotFramework, WireMock
* *Integration tests*: Selenium3, RobotFramework, WireMock
* *Others*: Lombok, Togglz, WebJars
49 changes: 12 additions & 37 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -325,45 +325,17 @@
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
</exclusion>
<exclusion>
<groupId>com.codeborne</groupId>
<artifactId>phantomjsdriver</artifactId>
</exclusion>
<exclusion>
<groupId>com.opera</groupId>
<artifactId>operadriver</artifactId>
</exclusion>
<exclusion>
<groupId>io.appium</groupId>
<artifactId>java-client</artifactId>
</exclusion>
<exclusion>
<groupId>io.selendroid</groupId>
<artifactId>selendroid-client</artifactId>
</exclusion>
<exclusion>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-edge-driver</artifactId>
</exclusion>
<exclusion>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-chrome-driver</artifactId>
<groupId>io.github.bonigarcia</groupId>
<artifactId>webdrivermanager</artifactId>
</exclusion>
<exclusion>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-ie-driver</artifactId>
</exclusion>
<exclusion>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-safari-driver</artifactId>
</exclusion>
<exclusion>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-leg-rc</artifactId>
</exclusion>
<exclusion>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-firefox-driver</artifactId>
<groupId>io.selendroid</groupId>
<artifactId>selendroid-client</artifactId>
</exclusion>
<exclusion>
<groupId>com.machinepublishers</groupId>
Expand Down Expand Up @@ -505,6 +477,9 @@
<!-- Redefine default value from spring-boot-dependencies (https://github.com/spring-projects/spring-boot/blob/v1.5.22.RELEASE/spring-boot-dependencies/pom.xml) -->
<hibernate-validator.version>5.4.2.Final</hibernate-validator.version>

<!-- Redefine default value from spring-boot-dependencies (https://github.com/spring-projects/spring-boot/blob/v1.5.22.RELEASE/spring-boot-dependencies/pom.xml) -->
<htmlunit.version>2.36.0</htmlunit.version>

<jacoco.plugin.version>0.8.2</jacoco.plugin.version>
<jasmine.plugin.version>2.2</jasmine.plugin.version>

Expand Down Expand Up @@ -554,18 +529,18 @@

<resources.plugin.version>3.1.0</resources.plugin.version>
<robotframework-httprequest.version>0.0.15</robotframework-httprequest.version>
<robotframework-plugin.version>1.4.7</robotframework-plugin.version>
<robotframework-selenium.version>2.53.1.1</robotframework-selenium.version>
<robotframework.version>3.0.4</robotframework.version>
<robotframework-plugin.version>1.5.1</robotframework-plugin.version>
<robotframework-selenium.version>3.141.59.2653</robotframework-selenium.version>
<robotframework.version>3.1.2</robotframework.version>

<!-- Don't forget to update version in the ResourceUrl class and in the src/main/webapp/WEB-INF/views/series/add.html -->
<selectizejs.version>0.12.5</selectizejs.version>

<!-- Redefine default value from spring-boot-dependencies (https://github.com/spring-projects/spring-boot/blob/v1.5.22.RELEASE/spring-boot-dependencies/pom.xml) -->
<selenium-htmlunit.version>2.21</selenium-htmlunit.version>
<selenium-htmlunit.version>2.36.0</selenium-htmlunit.version>

<!-- Redefine default value from spring-boot-dependencies (https://github.com/spring-projects/spring-boot/blob/v1.5.22.RELEASE/spring-boot-dependencies/pom.xml) -->
<selenium.version>2.53.1</selenium.version>
<selenium.version>3.141.59</selenium.version>

<!-- Redefine default value from spring-boot-dependencies (https://github.com/spring-projects/spring-boot/blob/v1.5.22.RELEASE/spring-boot-dependencies/pom.xml) -->
<servlet-api.version>3.1.0</servlet-api.version>
Expand Down
26 changes: 15 additions & 11 deletions src/main/scripts/ci/filter-out-htmlunit-messages.pl
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,28 @@
use warnings;

my @regexps = (
# [WARNING] CSS error: 'http://127.0.0.1:8081/public/bootstrap/3.4.1/css/bootstrap.min.css' [5:56298] Error in expression; ':' found after identifier "progid".
qr/\[WARNING\] CSS error: '[^']+' \[[^]]+\] Error in expression; [^\.]+\.\n/,

# [WARNING] CSS error: 'http://127.0.0.1:8081/public/bootstrap/3.4.1/css/bootstrap.min.css' [5:115558] Invalid color "#000\9".
qr/\[WARNING\] CSS error: '[^']+' \[[^]]+\] Invalid color "[^"]+"\.\n/,

# [WARNING] CSS error: 'http://127.0.0.1:8081/public/selectize/0.12.3/css/selectize.bootstrap3.css' [176:3] Error in declaration. '*' is not allowed as first char of a property.
qr/\[WARNING\] CSS error: '[^']+' \[[^]]+\] Error in declaration\. '\*' is not allowed as first char of a property\.\n/,

# [ERROR] runtimeError: message=[An invalid or illegal selector was specified (selector: '*,:x' error: Invalid selector: :x).] sourceName=[http://127.0.0.1:8081/public/jquery/1.9.1/jquery.min.js] line=[4] lineSource=[null] lineOffset=[0]
qr/\[ERROR\] runtimeError: message=\[[^]]+\] sourceName=\[[^]]+\] line=\[[^]]+\] lineSource=\[[^]]+\] lineOffset=\[[^]]+\]\n/,

# [ERROR] runtimeError: message=[An invalid or illegal selector was specified (selector: '[id='sizzle-1487943406281'] [data-selectable]:first' error: Invalid selector: [id="sizzle-1487943406281"] [data-selectable]:first).] sourceName=[http://127.0.0.1:8081/public/jquery/1.9.1/jquery.min.js] line=[4] lineSource=[null] lineOffset=[0]
qr/\[ERROR\] runtimeError: message=\[[^\(]+\(selector: '\[id='sizzle-[^']+'\] \[data-selectable\]:first' error: Invalid selector: \[id="sizzle-[^"]+"\] \[data-selectable\]:first\)\.\] sourceName=\[[^]]+\] line=\[[^]]+\] lineSource=\[[^]]+\] lineOffset=\[[^]]+\]\n/,

# [INFO] Bad input type: "url", creating a text input
# [INFO] Bad input type: "select-one", creating a text input
qr/\[INFO\] Bad input type: "[^"]+", creating a text input\n/
qr/\[INFO\] Bad input type: "[^"]+", creating a text input\n/,

# Google Charts:
# [WARNING] Obsolete content type encountered: 'text/javascript'.
qr/\[WARNING\] Obsolete content type encountered: 'text.javascript'\.\n/,

# Google Charts:
# [WARNING] CSS error: 'https://www.gstatic.com/charts/44/css/core/tooltip.css'
# [3:38] Error in pseudo class or element. (Invalid token " ". Was expecting one of: <IDENT>, ":",
# <FUNCTION_NOT>, <FUNCTION_LANG>, <FUNCTION>.)
qr/\[WARNING\] CSS error: 'https:..www\.gstatic\..*\n/,

# Google Charts:
# [WARNING] CSS warning: 'https://www.gstatic.com/charts/44/css/core/tooltip.css' [3:38] Ignoring the whole rule.
qr/\[WARNING\] CSS warning: 'https:..www\.gstatic\..*\n/
);

foreach my $line (<STDIN>) {
Expand Down
28 changes: 14 additions & 14 deletions src/test/robotframework/account/activation/logic.robot
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@ Force Tags account activation logic

*** Test Cases ***
Activate account with full info (fill all fields)
Input Text id=login 1st-test-login
Input Text id=name Test Suite
Input Text id=password test-password
Input Text id=passwordConfirmation test-password
Input Text id=activationKey 7777744444
Submit Form id=activate-account-form
Input Text id:login 1st-test-login
Input Text id:name Test Suite
Input Text id:password test-password
Input Text id:passwordConfirmation test-password
Input Text id:activationKey 7777744444
Submit Form id:activate-account-form
Location Should Be ${SITE_URL}/account/auth
Element Text Should Be id=msg-success Account successfully activated! Now you can pass authentication.
Element Text Should Be id:msg-success Account successfully activated! Now you can pass authentication.

Activate account with only required info (fill only mandatory fields)
Input Text id=login 2nd-test-login
Input Text id=name ${EMPTY}
Input Text id=password test-password
Input Text id=passwordConfirmation test-password
Input Text id=activationKey 4444477777
Submit Form id=activate-account-form
Input Text id:login 2nd-test-login
Input Text id:name ${EMPTY}
Input Text id:password test-password
Input Text id:passwordConfirmation test-password
Input Text id:activationKey 4444477777
Submit Form id:activate-account-form
Location Should Be ${SITE_URL}/account/auth
Element Text Should Be id=msg-success Account successfully activated! Now you can pass authentication.
Element Text Should Be id:msg-success Account successfully activated! Now you can pass authentication.

*** Keywords ***
Before Test Suite
Expand Down
57 changes: 32 additions & 25 deletions src/test/robotframework/account/activation/misc-anonymous.robot
Original file line number Diff line number Diff line change
@@ -1,34 +1,36 @@
*** Settings ***
Documentation Verify miscellaneous aspects of account activation from anonymous user
Library SeleniumLibrary
Resource ../../selenium.utils.robot
Suite Setup Before Test Suite
Suite Teardown Close Browser
Test Setup Disable Client Validation
Force Tags account activation misc

*** Test Cases ***
Activation key should be auto filled from url
Go To ${SITE_URL}/account/activate?key=7777755555
Textfield Value Should Be id=activationKey 7777755555
Textfield Value Should Be id:activationKey 7777755555

Most short login should be accepted
Input Text id=login ab
Submit Form id=activate-account-form
Page Should Not Contain Element id=login.errors
Input Text id:login ab
Submit Form id:activate-account-form
Page Should Not Contain Element id:login.errors

Most long login should be accepted
Input Text id=login abcde1234567890
Submit Form id=activate-account-form
Page Should Not Contain Element id=login.errors
Input Text id:login abcde1234567890
Submit Form id:activate-account-form
Page Should Not Contain Element id:login.errors

Login with allowed characters should be accepted
Input Text id=login t.3.s.7-T_E_S_T
Submit Form id=activate-account-form
Page Should Not Contain Element id=login.errors
Input Text id:login t.3.s.7-T_E_S_T
Submit Form id:activate-account-form
Page Should Not Contain Element id:login.errors

Login should be striped from leading and trailing spaces
Input Text id=login ${SPACE * 2}testLogin${SPACE * 2}
Submit Form id=activate-account-form
Textfield Value Should Be id=login testLogin
Input Text id:login ${SPACE * 2}testLogin${SPACE * 2}
Submit Form id:activate-account-form
Textfield Value Should Be id:login testLogin

Name with allowed characters should be accepted
[Template] Name should not cause an error
Expand All @@ -37,27 +39,32 @@ Name with allowed characters should be accepted
Семён Якушев

Name should be striped from leading and trailing spaces
Input Text id=name ${SPACE * 2}test${SPACE * 2}
Submit Form id=activate-account-form
Textfield Value Should Be id=name test
Input Text id:name ${SPACE * 2}test${SPACE * 2}
Submit Form id:activate-account-form
Textfield Value Should Be id:name test

Most short password should be accepted
Input Text id=password 1234
Submit Form id=activate-account-form
Page Should Not Contain Element id=password.errors
Input Text id:password 1234
Submit Form id:activate-account-form
Page Should Not Contain Element id:password.errors

Password with allowed characters should be accepted
Input Text id=password t3s7-T_E_S_T
Submit Form id=activate-account-form
Page Should Not Contain Element id=password.errors
Input Text id:password t3s7-T_E_S_T
Submit Form id:activate-account-form
Page Should Not Contain Element id:password.errors

*** Keywords ***
Before Test Suite
Open Browser ${SITE_URL}/account/activate ${BROWSER}
Register Keyword To Run On Failure Log Source

Disable Client Validation
Remove Element Attribute password required
Remove Element Attribute passwordConfirmation required

Name should not cause an error
[Arguments] ${name}
Input Text id=name ${name}
Submit Form id=activate-account-form
Page Should Not Contain Element id=name.errors
Disable Client Validation
Input Text id:name ${name}
Submit Form id:activate-account-form
Page Should Not Contain Element id:name.errors
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Force Tags account activation misc
*** Test Cases ***
User cannot activate account again
Page Should Contain You have already activated account
Page Should Not Contain Element id=activate-account-form
Page Should Not Contain Element id:activate-account-form

*** Keywords ***
Before Test Suite
Expand Down
Loading