File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ const webdriver = require ( 'selenium-webdriver' ) ;
2+ const { By, until } = webdriver ;
3+
4+ ( async function ( ) {
5+ const driver = new webdriver . Builder ( )
6+ . usingServer ( 'http://localhost:9515' )
7+ . withCapabilities ( {
8+ 'goog:chromeOptions' : {
9+ debuggerAddress : 'localhost:9222' ,
10+ }
11+ } )
12+ . forBrowser ( 'chrome' )
13+ . build ( ) ;
14+
15+ try {
16+ await driver . wait ( until . elementLocated ( By . className ( 'card' ) ) , 30000 ) ;
17+ await driver . findElement ( By . className ( 'card' ) ) . click ( ) ;
18+ await driver . wait ( until . elementLocated ( By . className ( 'add-container' ) ) , 10000 ) ;
19+ await driver . findElement ( By . className ( 'env-button2' ) ) . click ( ) ;
20+ await driver . wait ( until . elementLocated ( By . className ( 'add-container' ) ) , 10000 ) ;
21+
22+ await driver . findElement ( By . id ( 'serv-type' ) ) . sendKeys ( 'Docker' ) ;
23+ await driver . findElement ( By . id ( 'db-type' ) ) . sendKeys ( 'SQL' ) ;
24+ await driver . findElement ( By . id ( 'db-uri' ) ) . sendKeys ( 'mongodb://localhost:27017/mydb' ) ;
25+ await driver . findElement ( By . id ( 'db-name' ) ) . sendKeys ( 'My App' ) ;
26+ await driver . findElement ( By . id ( 'db-desc' ) ) . sendKeys ( 'A description of my app' ) ;
27+
28+ await driver . findElement ( By . xpath ( '//button[text()="Submit"]' ) ) . click ( ) ;
29+ console . log ( 'E2E test completed successfully' ) ;
30+
31+ } catch ( error ) {
32+ console . error ( 'E2E test failed:' , error ) ;
33+ } finally {
34+ await driver . quit ( ) ;
35+ }
36+ } ) ( ) ;
You can’t perform that action at this time.
0 commit comments