@@ -5,25 +5,51 @@ const { buildDriver, goToHome, captureScreensFor, teardown } = require('../../ut
55
66const LoginPage = require ( '../../pageobjects/LoginPage' )
77const OverviewPage = require ( '../../pageobjects/OverviewPage' )
8- const ConnectionsTab = require ( '../../pageobjects/ConnectionsTab ' )
8+ const ConnectionsPage = require ( '../../pageobjects/ConnectionsPage ' )
99
10- describe ( 'Given an amqp10 connection is selected' , function ( ) {
11- let homePage
10+ var container = require ( 'rhea' )
11+ container . on ( 'message' , function ( context ) {
12+ console . log ( "Received message : " + context . message . body )
13+ } )
14+ container . once ( 'sendable' , function ( context ) {
15+ console . log ( "Sending message .." )
16+ context . sender . send ( { body :'Hello World!' } )
17+ } )
18+
19+
20+ describe ( 'Given an amqp10 connection is selected' , function ( ) {
1221 let captureScreen
13- let connections
22+ let connectionsPage
23+ let connection
1424
1525 before ( async function ( ) {
1626 driver = buildDriver ( )
1727 await goToHome ( driver )
1828 login = new LoginPage ( driver )
1929 overview = new OverviewPage ( driver )
20- connections = new ConnectionsTab ( driver )
30+ connectionsPage = new ConnectionsPage ( driver )
2131 captureScreen = captureScreensFor ( driver , __filename )
2232 await login . login ( 'management' , 'guest' )
2333 await overview . isLoaded ( )
34+
35+ connection = container . connect (
36+ { 'host' : process . env . RABBITMQ_HOSTNAME || 'rabbitmq' ,
37+ 'port' : process . env . RABBITMQ_AMQP_PORT || 5672 ,
38+ 'username' : process . env . RABBITMQ_AMQP_USERNAME || 'guest' ,
39+ 'password' : process . env . RABBITMQ_AMQP_PASSWORD || 'guest' ,
40+ 'id' : "selenium-connection-id" ,
41+ 'container-id' : "selenium-container-id"
42+ } )
43+ connection . open_receiver ( 'examples' )
44+ connection . open_sender ( 'examples' )
2445
2546 await overview . clickOnConnectionsTab ( )
26- await connections . clickOnConnection ( )
47+
48+ console . log ( "Wait until connections page is loaded" )
49+ await connectionsPage . isLoaded ( )
50+ console . log ( "Getting connections .." )
51+ connections_table = await connectionsPage . getConnectionsTable ( 20 )
52+ console . log ( "a :" + connections_table )
2753 } )
2854
2955 it ( 'can list session information' , async function ( ) {
@@ -37,7 +63,15 @@ describe('Given an amqp10 connection is selected', function () {
3763 // flow control
3864 } )
3965
40- after ( async function ( ) {
66+ after ( async function ( ) {
4167 await teardown ( driver , this , captureScreen )
68+ try {
69+ if ( connection != null ) {
70+ connection . close ( )
71+ }
72+ } catch ( error ) {
73+ console . error ( "Failed to close amqp10 connection due to " + error ) ;
74+ }
4275 } )
76+
4377} )
0 commit comments