-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Selenium: Create new class 'WebDriverWaitFactory' #8685
Conversation
There are tests from org.eclipse.che.selenium.filewatcher package which use non-default selenium web driver instances. So, it's better to ensure that usage of WebDriverWaitFactory doesn't break that tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Solution works correctly with multi-thread test execution and when there are several selenium web driver instances at the same test:
Test log of execution 4 tests in 2 threads
2018-02-09 17:47:10,319[pool-1-thread-2] [INFO ] [.e.c.s.c.i.SeleniumTestHandler 204] - Dependencies injection in org.eclipse.che.selenium.editor.autocomplete.QuickFixAndCodeAssistantFeaturesTest 2018-02-09 17:47:10,319[pool-1-thread-1] [INFO ] [.e.c.s.c.i.SeleniumTestHandler 204] - Dependencies injection in org.eclipse.che.selenium.editor.autocomplete.OpenDeclarationTest 2018-02-09 17:47:10,621[onPool-worker-1] [INFO ] [c.c.TestWorkspaceServiceClient 201] - Workspace name='workspaceb03swn' and id='workspaceh5tr87b5dzrjngzh' created 2018-02-09 17:47:11,073[onPool-worker-2] [INFO ] [c.c.TestWorkspaceServiceClient 201] - Workspace name='workspacegmu37s' and id='workspaceq3moidvufrcvwmbw' created 2018-02-09 17:47:29,719[onPool-worker-1] [INFO ] [o.e.c.s.c.w.TestWorkspaceImpl 61] - Workspace name='workspaceb03swn' id='workspaceh5tr87b5dzrjngzh' started in 19 sec. 2018-02-09 17:47:30,156[onPool-worker-2] [INFO ] [o.e.c.s.c.w.TestWorkspaceImpl 61] - Workspace name='workspacegmu37s' id='workspaceq3moidvufrcvwmbw' started in 19 sec. 2018-02-09 17:47:30,306[pool-1-thread-2] [INFO ] [o.e.c.s.p.WebDriverWaitFactory 43] - -------------- WebDriverWaitFactory=1408514945: put into map(timeout=10, webdriver=664460836) 2018-02-09 17:47:30,307[pool-1-thread-2] [INFO ] [o.e.c.s.p.WebDriverWaitFactory 43] - -------------- WebDriverWaitFactory=1408514945: put into map(timeout=5, webdriver=664460836) 2018-02-09 17:47:30,603[pool-1-thread-1] [INFO ] [o.e.c.s.p.WebDriverWaitFactory 43] - -------------- WebDriverWaitFactory=596944149: put into map(timeout=10, webdriver=498076990) 2018-02-09 17:47:30,603[pool-1-thread-1] [INFO ] [o.e.c.s.p.WebDriverWaitFactory 43] - -------------- WebDriverWaitFactory=596944149: put into map(timeout=5, webdriver=498076990) 2018-02-09 17:47:35,835[pool-1-thread-2] [INFO ] [o.e.c.s.p.WebDriverWaitFactory 43] - -------------- WebDriverWaitFactory=1408514945: put into map(timeout=120, webdriver=664460836) 2018-02-09 17:47:36,501[pool-1-thread-1] [INFO ] [o.e.c.s.p.WebDriverWaitFactory 43] - -------------- WebDriverWaitFactory=596944149: put into map(timeout=120, webdriver=498076990) 2018-02-09 17:49:16,171[pool-1-thread-2] [INFO ] [.e.c.s.c.i.SeleniumTestHandler 269] - Processing @PreDestroy annotation in org.eclipse.che.selenium.editor.autocomplete.QuickFixAndCodeAssistantFeaturesTest 2018-02-09 17:49:18,205[pool-1-thread-2] [INFO ] [c.c.TestWorkspaceServiceClient 148] - Workspace name='workspaceb03swn', id='workspaceh5tr87b5dzrjngzh', username='che' removed 2018-02-09 17:49:18,283[pool-1-thread-2] [INFO ] [.e.c.s.c.i.SeleniumTestHandler 204] - Dependencies injection in org.eclipse.che.selenium.filewatcher.EditFilesWithTabsTest 2018-02-09 17:49:18,984[onPool-worker-3] [INFO ] [c.c.TestWorkspaceServiceClient 201] - Workspace name='workspacearjbxd' and id='workspacepf2qizo7wkvq69ni' created 2018-02-09 17:49:35,059[onPool-worker-3] [INFO ] [o.e.c.s.c.w.TestWorkspaceImpl 61] - Workspace name='workspacearjbxd' id='workspacepf2qizo7wkvq69ni' started in 16 sec. 2018-02-09 17:49:35,471[pool-1-thread-2] [INFO ] [o.e.c.s.p.WebDriverWaitFactory 43] - -------------- WebDriverWaitFactory=1742965112: put into map(timeout=10, webdriver=440325692) 2018-02-09 17:49:35,471[pool-1-thread-2] [INFO ] [o.e.c.s.p.WebDriverWaitFactory 43] - -------------- WebDriverWaitFactory=1742965112: put into map(timeout=5, webdriver=440325692) 2018-02-09 17:49:35,913[pool-1-thread-2] [INFO ] [o.e.c.s.p.WebDriverWaitFactory 43] - -------------- WebDriverWaitFactory=1837806434: put into map(timeout=10, webdriver=374951906) 2018-02-09 17:49:35,913[pool-1-thread-2] [INFO ] [o.e.c.s.p.WebDriverWaitFactory 43] - -------------- WebDriverWaitFactory=1837806434: put into map(timeout=5, webdriver=374951906) 2018-02-09 17:49:40,133[pool-1-thread-2] [INFO ] [o.e.c.s.p.WebDriverWaitFactory 43] - -------------- WebDriverWaitFactory=1742965112: put into map(timeout=120, webdriver=440325692) 2018-02-09 17:49:45,827[pool-1-thread-2] [INFO ] [o.e.c.s.p.WebDriverWaitFactory 43] - -------------- WebDriverWaitFactory=1742965112: put into map(timeout=20, webdriver=440325692) 2018-02-09 17:49:50,051[pool-1-thread-2] [INFO ] [o.e.c.s.p.WebDriverWaitFactory 43] - -------------- WebDriverWaitFactory=1837806434: put into map(timeout=120, webdriver=374951906) 2018-02-09 17:49:52,771[pool-1-thread-2] [INFO ] [o.e.c.s.p.WebDriverWaitFactory 43] - -------------- WebDriverWaitFactory=1837806434: put into map(timeout=20, webdriver=374951906) 2018-02-09 17:51:09,173[pool-1-thread-2] [INFO ] [.e.c.s.c.i.SeleniumTestHandler 269] - Processing @PreDestroy annotation in org.eclipse.che.selenium.filewatcher.EditFilesWithTabsTest 2018-02-09 17:51:11,201[pool-1-thread-2] [INFO ] [c.c.TestWorkspaceServiceClient 148] - Workspace name='workspacearjbxd', id='workspacepf2qizo7wkvq69ni', username='che' removed 2018-02-09 17:51:11,345[pool-1-thread-2] [INFO ] [.e.c.s.c.i.SeleniumTestHandler 204] - Dependencies injection in org.eclipse.che.selenium.filewatcher.RefactoringFeatureTest 2018-02-09 17:51:12,048[onPool-worker-4] [INFO ] [c.c.TestWorkspaceServiceClient 201] - Workspace name='workspace9uc0k1' and id='workspace7clcgnccx61om480' created 2018-02-09 17:51:28,100[onPool-worker-4] [INFO ] [o.e.c.s.c.w.TestWorkspaceImpl 61] - Workspace name='workspace9uc0k1' id='workspace7clcgnccx61om480' started in 16 sec. 2018-02-09 17:51:28,506[pool-1-thread-2] [INFO ] [o.e.c.s.p.WebDriverWaitFactory 43] - -------------- WebDriverWaitFactory=2073128821: put into map(timeout=10, webdriver=939580056) 2018-02-09 17:51:28,506[pool-1-thread-2] [INFO ] [o.e.c.s.p.WebDriverWaitFactory 43] - -------------- WebDriverWaitFactory=2073128821: put into map(timeout=5, webdriver=939580056) 2018-02-09 17:51:28,887[pool-1-thread-2] [INFO ] [o.e.c.s.p.WebDriverWaitFactory 43] - -------------- WebDriverWaitFactory=135037295: put into map(timeout=10, webdriver=2014752220) 2018-02-09 17:51:28,887[pool-1-thread-2] [INFO ] [o.e.c.s.p.WebDriverWaitFactory 43] - -------------- WebDriverWaitFactory=135037295: put into map(timeout=5, webdriver=2014752220) 2018-02-09 17:51:39,777[pool-1-thread-2] [INFO ] [o.e.c.s.p.WebDriverWaitFactory 43] - -------------- WebDriverWaitFactory=2073128821: put into map(timeout=120, webdriver=939580056) 2018-02-09 17:51:42,536[pool-1-thread-2] [INFO ] [o.e.c.s.p.WebDriverWaitFactory 43] - -------------- WebDriverWaitFactory=2073128821: put into map(timeout=20, webdriver=939580056) 2018-02-09 17:51:49,306[pool-1-thread-2] [INFO ] [o.e.c.s.p.WebDriverWaitFactory 43] - -------------- WebDriverWaitFactory=135037295: put into map(timeout=120, webdriver=2014752220) 2018-02-09 17:51:49,457[pool-1-thread-2] [INFO ] [o.e.c.s.p.WebDriverWaitFactory 43] - -------------- WebDriverWaitFactory=135037295: put into map(timeout=20, webdriver=2014752220) 2018-02-09 17:52:36,748[main] [INFO ] [.e.c.s.c.i.SeleniumTestHandler 413] - Cleaning up test environment... 2018-02-09 17:52:36,748[main] [INFO ] [.e.c.s.c.i.SeleniumTestHandler 269] - Processing @PreDestroy annotation in org.eclipse.che.selenium.editor.autocomplete.OpenDeclarationTest 2018-02-09 17:52:38,779[main] [INFO ] [c.c.TestWorkspaceServiceClient 148] - Workspace name='workspacegmu37s', id='workspaceq3moidvufrcvwmbw', username='che' removed 2018-02-09 17:52:38,855[main] [INFO ] [.e.c.s.c.i.SeleniumTestHandler 269] - Processing @PreDestroy annotation in org.eclipse.che.selenium.filewatcher.RefactoringFeatureTest 2018-02-09 17:52:40,892[main] [INFO ] [c.c.TestWorkspaceServiceClient 148] - Workspace name='workspace9uc0k1', id='workspace7clcgnccx61om480', username='che' removed [INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 333.454 s - in TestSuite
What does this PR do?
Create new class 'WebDriverWaitFactory' for providing WebDriverWait instances
What issues does this PR fix or reference?
Issue: #8472
Release Notes
Docs PR