Skip to content
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

https://github.com/jakartaee/faces/issues/1722: Adding ported Selenium Ajax Tests #1732

Closed
wants to merge 1 commit into from

Conversation

werpu
Copy link
Contributor

@werpu werpu commented Nov 22, 2022

This pull request adds Selenium ported TCK Ajax tests with an added Chrome selenium web driver.
(Chrome must be installed on the system to run the tests). This configuration allows to test for ES6 and newer dom levels, where HTMLUnit fails due to not supporting newer specs.

@werpu
Copy link
Contributor Author

werpu commented Nov 22, 2022

My Tests are working once you have Chrome in place.
Also sidenote, I personally would want to dual license the Selenium webdriver code I have contributed to this project under both ECL or ASL2 or simply ASL2, because I might add this one to MyFaces as well, for the integration tests we have.
Given that this code is from me anyway, a dual license should be no problem if the Jakarta project wants ECA!

Tests will fail very likely due to the missing Chrome in the build chain so someone from the project should take over. @arjantijms ?

@werpu
Copy link
Contributor Author

werpu commented Dec 7, 2022

I have to reupdate this pull request, given there are lots of fixes in the master branch.
I will re-port from the master branch again.

So expect an update from me next week on this issue.

@brideck
Copy link
Contributor

brideck commented Dec 9, 2022

@werpu Giving this update a try to see how it would work for us in Open Liberty, and I'm seeing a weird error. I've never used Selenium before, so I was hoping you might be familiar with what's going wrong:

org.openqa.selenium.SessionNotCreatedException:
Could not start a new session. Response code 500. Message: unknown error: Chrome failed to start: exited abnormally.
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Build info: version: '4.6.0', revision: '79f1c02ae20'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '4.15.0-200-generic', java.version: '11.0.14-internal'
Driver info: org.openqa.selenium.chrome.ChromeDriver
...
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:146)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:101)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:67)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:156)
...

I've seen a StackOverflow that thinks it's a mismatch between Chrome and ChromeDriver versions. My Chrome appears to be v108. Not sure how to check on the ChromeDriver specific version.

@werpu
Copy link
Contributor Author

werpu commented Dec 11, 2022

Did not have this issue yet, but it seems like the selenium driver cannot start chrome for whatever reason. Can the user which runs the tests start chrome? Chrome is started headless with --no-sandbox, so either chrome cannot be found or the driver cannot start it for another reason (have been running chrome 108 well here on a mac)

image

The code uses the WebDriverManager to deal with the internals of starting chrome, you might get it up and running by triggering the WebDriverManager differently

https://bonigarcia.dev/webdrivermanager/

(The init code is in the class ChromeDevtoolsDriver in the utils package.

@werpu
Copy link
Contributor Author

werpu commented Dec 13, 2022

Hi also question back maybe @arjantijms can answer it. I am porting the latest version of the ajax TCK tests to selenium (which seem to be hosted in master, given the updates and fixes), however I cannot get master to compile, the branch 4.0.1 which I used before seems to work fine.

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:3.2.0:copy (copy) on project jakarta-faces-tck: Unable to find/resolve artifact.: Could not find artifact org.glassfish:jakarta.faces:jar:4.0.1-SNAPSHOT in jakarta-staging (https://jakarta.oss.sonatype.org/content/repositories/staging) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command

any idea?

@BalusC
Copy link
Member

BalusC commented Dec 13, 2022

Could not find artifact org.glassfish:jakarta.faces:jar:4.0.1-SNAPSHOT

Hmm so snapshots are not deployed anymore?
You'll have to locally revert mojarra.version property in tck/pom.xml to 4.0.0.
Or alternatively build yourself locally via mvn clean install on Mojarra 4.0 branch.
We should in long term look for a way to externalize this config property.

@werpu
Copy link
Contributor Author

werpu commented Dec 13, 2022

Thanks for the quick help... probably reverting it to stable should do the trick, I just need to get the tests running anyway.

@werpu
Copy link
Contributor Author

werpu commented Dec 14, 2022

Closing it, have opened a new pull request, with a newer code version, and this time properly on master

@werpu werpu closed this Dec 14, 2022
BalusC added a commit that referenced this pull request Jan 18, 2023
#1732: Selenium tests for the ajax TCK (master branch)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants