Skip to content

Commit ace0267

Browse files
Navigate from connections to connection page
1 parent 7e89060 commit ace0267

File tree

5 files changed

+40
-18
lines changed

5 files changed

+40
-18
lines changed

deps/rabbitmq_management/priv/www/js/tmpl/connection.ejs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<h2>Connection <%= fmt_string(connection.name) %> <%= fmt_maybe_vhost(connection.vhost) %></h1>
22

33
<% if (!disable_stats) { %>
4-
<div class="section">
4+
<div class="section" id="connection-overview-section">
55
<h2>Overview</h2>
66
<div class="hider updatable">
77
<%= data_rates('data-rates-conn', connection, 'Data rates') %>
@@ -86,7 +86,7 @@
8686
8787
<% if (connection.protocol === 'AMQP 1-0') { %>
8888
89-
<div class="section">
89+
<div class="section" id="connection-sessions-section">
9090
<h2 class="updatable" >Sessions (<%=(sessions.length)%>)</h2>
9191
<div class="hider updatable">
9292
<%= format('sessions-list', {'sessions': sessions}) %>
@@ -95,7 +95,7 @@
9595
9696
<% } else { %>
9797
98-
<div class="section">
98+
<div class="section" id="connection-channels-section">
9999
<h2 class="updatable" >Channels (<%=(channels.length)%>) </h2>
100100
<div class="hider updatable">
101101
<%= format('channels-list', {'channels': channels, 'mode': 'connection'}) %>
@@ -149,7 +149,7 @@
149149
<% } %>
150150
151151
<% if (properties_size(connection.client_properties) > 0) { %>
152-
<div class="section-hidden">
152+
<div class="section-hidden" id="connection-client-properies-section">
153153
<h2>Client properties</h2>
154154
<div class="hider">
155155
<%= fmt_table_long(connection.client_properties) %>
@@ -158,7 +158,7 @@
158158
<% } %>
159159
160160
<% if(connection.reductions || connection.garbage_collection) { %>
161-
<div class="section-hidden">
161+
<div class="section-hidden" id="connection-runtime-metrics-section">
162162
<h2>Runtime Metrics (Advanced)</h2>
163163
<div class="hider updatable">
164164
<%= data_reductions('reductions-rates-conn', connection) %>
@@ -197,7 +197,7 @@
197197
<% } %>
198198
<% } %>
199199

200-
<div class="section-hidden">
200+
<div class="section-hidden" id="connection-close-section">
201201
<h2>Close this connection</h2>
202202
<div class="hider">
203203
<form action="#/connections" method="delete" class="confirm">

selenium/amqp10-roundtriptest/src/main/java/com/rabbitmq/amqp1_0/RoundTripTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ public static void main(String args[]) throws Exception {
3030
String username = args.length > 0 ? args[0] : getEnv("RABBITMQ_AMQP_USERNAME", "guest");
3131
String password = args.length > 1 ? args[1] : getEnv("RABBITMQ_AMQP_PASSWORD", "guest");
3232

33-
boolean usemtls = Boolean.parseBoolean(getEnv("AMQP_USE_MTLS", "false"));
34-
33+
boolean usemtls = Boolean.parseBoolean(getEnv("AMQP_USE_MTLS", "false"));
3534

3635
if ("amqps".equals(scheme)) {
3736
List<String> connectionParams = new ArrayList<String>();
@@ -86,7 +85,7 @@ public static void main(String args[]) throws Exception {
8685

8786
assertEquals(message.getText(), receivedMessage.getText());
8887

89-
Thread.sleep(30000);
88+
Thread.sleep(60000);
9089
}
9190
}
9291
private static Connection createConnection(ConnectionFactory factory,

selenium/test/connections/amqp10/sessions-for-monitoring-user.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const { buildDriver, goToHome, captureScreensFor, teardown } = require('../../ut
66
const LoginPage = require('../../pageobjects/LoginPage')
77
const OverviewPage = require('../../pageobjects/OverviewPage')
88
const ConnectionsPage = require('../../pageobjects/ConnectionsPage')
9+
const ConnectionPage = require('../../pageobjects/ConnectionPage')
910

1011
var container = require('rhea') // https://github.com/amqp/rhea
1112
var receivedAmqpMessageCount = 0
@@ -26,6 +27,7 @@ container.once('sendable', function (context) {
2627
describe('Given an amqp10 connection opened, listed and clicked on it', function () {
2728
let captureScreen
2829
let connectionsPage
30+
let connectionPage
2931
let connection
3032

3133
before(async function () {
@@ -34,6 +36,7 @@ describe('Given an amqp10 connection opened, listed and clicked on it', function
3436
login = new LoginPage(driver)
3537
overview = new OverviewPage(driver)
3638
connectionsPage = new ConnectionsPage(driver)
39+
connectionPage = new ConnectionPage(driver)
3740
captureScreen = captureScreensFor(driver, __filename)
3841
await login.login('monitoring-only', 'guest')
3942
await overview.isLoaded()
@@ -55,12 +58,15 @@ describe('Given an amqp10 connection opened, listed and clicked on it', function
5558

5659
connections_table = await connectionsPage.getConnectionsTable(20)
5760
assert.equal(1, connections_table.length)
58-
await connectionsPage.clickOnConnection(1)
61+
await connectionsPage.clickOnConnection(2)
62+
console.log("clicked on connection")
63+
await connectionPage.isLoaded()
5964
})
6065

6166

6267
it('can list session information', async function () {
63-
// flow control state
68+
let session_table = await connectionPage.list_sessions()
69+
console.log("sessions " + session_table)
6470
})
6571

6672
it('can list link information', async function () {
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
const { By, Key, until, Builder } = require('selenium-webdriver')
2+
3+
const BasePage = require('./BasePage')
4+
5+
6+
const OVERVIEW_SECTION = By.css('div#main div.section#connection-overview-section')
7+
const SESSIONS_SECTION = By.css('div#main div.section#connection-sessions-section')
8+
const SESSIONS_TABLE = By.css('div.section#connection-sessions-section table.list')
9+
const CONNECTION_NAME = By.css('div#main h2')
10+
11+
12+
module.exports = class ConnectionPage extends BasePage {
13+
async isLoaded() {
14+
return this.waitForDisplayed(CONNECTION_NAME)
15+
}
16+
async getName() {
17+
return this.getText(CONNECTION_NAME)
18+
}
19+
async list_sessions() {
20+
// maybe ensure the section is expanded
21+
await this.waitForDisplayed(SESSIONS_SECTION)
22+
return this.getTable(SESSIONS_TABLE)
23+
}
24+
}

selenium/test/pageobjects/OverviewPage.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,5 @@ module.exports = class OverviewPage extends BasePage {
2626
}
2727
async downloadBrokerDefinitions(filename) {
2828
return this.click(DOWNLOAD_DEFINITIONS_SECTION)
29-
30-
/*
31-
await this.driver.sleep(1000)
32-
await this.sendKeys(CHOOSE_BROKER_DOWNLOAD_FILE, filename)
33-
await this.click(DOWNLOAD_BROKER_FILE)
34-
return driver.sleep(5000);
35-
*/
3629
}
3730
}

0 commit comments

Comments
 (0)