Skip to content

Commit 7fc4ad4

Browse files
Validate consumer count on quorum queue
1 parent b8a662d commit 7fc4ad4

File tree

4 files changed

+20
-10
lines changed

4 files changed

+20
-10
lines changed

deps/rabbitmq_management/priv/www/js/tmpl/quorum-queue-stats.ejs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
1-
<table class="facts facts-l">
1+
<table class="facts facts-l" id="details-queue-stats-table">
2+
<tbody>
23
<tr>
34
<th>State</th>
45
<td><%= fmt_object_state(queue) %></td>
56
</tr>
67
<% if(queue.consumers) { %>
78
<tr>
89
<th>Consumers</th>
9-
<td><%= fmt_string(queue.consumers) %></td>
10+
<td id="consumers"><%= fmt_string(queue.consumers) %></td>
1011
</tr>
1112
<% } else if(queue.hasOwnProperty('consumer_details')) { %>
1213
<tr>
1314
<th>Consumers</th>
14-
<td><%= fmt_string(queue.consumer_details.length) %></td>
15+
<td id="consumers"><%= fmt_string(queue.consumer_details.length) %></td>
1516
</tr>
1617
<% } %>
1718
<% if(queue.hasOwnProperty('publishers')) { %>
1819
<tr>
1920
<th>Publishers</th>
20-
<td><%= fmt_string(queue.publishers) %></td>
21+
<td id="publishers"><%= fmt_string(queue.publishers) %></td>
2122
</tr>
2223
<% } %>
2324
<tr>
@@ -30,6 +31,7 @@
3031
<td><%= fmt_string(queue.delivery_limit) %></td>
3132
</tr>
3233
<% } %>
34+
</tbody>
3335
</table>
3436

3537
<table class="facts">

selenium/test/pageobjects/BasePage.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,9 @@ module.exports = class BasePage {
158158
let tbody = await table.findElement(By.css('tbody'))
159159
let rows = await tbody.findElements(By.xpath("./child::*"))
160160

161-
console.log("getTableMiniUsingTableElement found " + rows.length + " rows")
162161
let table_model = []
163162
for (let row of rows) {
164163
let columnName = await row.findElement(By.css('th')).getText()
165-
console.log("getTableMiniUsingTableElement parsing column Name " + columnName )
166164

167165
let columnValue = await row.findElement(By.css('td'))
168166
let columnContent = await columnValue.findElement(By.xpath("./child::*"))

selenium/test/pageobjects/QueuePage.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ const QUEUE_NAME = By.css('div#main h1 b')
77

88
const DELETE_SECTION = By.css('div#main div#delete')
99
const DELETE_BUTTON = By.css('div#main div#delete input[type=submit]')
10-
const FEATURES = By.css('table#details-queue-table td#details-queue-features table.mini')
10+
const FEATURES_TABLE = By.css('table#details-queue-table td#details-queue-features table.mini')
11+
const STATS_CONSUMER_COUNT = By.css('table#details-queue-stats-table td#consumers')
1112

1213
module.exports = class QueuePage extends BasePage {
1314
async isLoaded() {
@@ -16,8 +17,11 @@ module.exports = class QueuePage extends BasePage {
1617
async getName() {
1718
return this.getText(QUEUE_NAME)
1819
}
20+
async getConsumerCount() {
21+
return this.getText(STATS_CONSUMER_COUNT)
22+
}
1923
async getFeatures() {
20-
return this.getTableMini(FEATURES)
24+
return this.getTableMini(FEATURES_TABLE)
2125
}
2226
async ensureDeleteQueueSectionIsVisible() {
2327
await this.click(DELETE_SECTION)

selenium/test/queuesAndStreams/view-qq-consumers.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,16 @@ describe('Given a quorum queue', function () {
4747
await queuePage.isLoaded()
4848
assert.equal(queueName, await queuePage.getName())
4949
let table = await queuePage.getFeatures()
50-
console.log("Queue features: " + JSON.stringify(table))
50+
assert.equal(table[0].name, "arguments:")
51+
let expectedArguments = [{"name":"x-queue-type:","value":"quorum"}]
52+
assert.equal(JSON.stringify(table[0].value), JSON.stringify(expectedArguments))
53+
assert.equal(table[1].name, "durable:")
54+
assert.equal(table[1].value, "true")
55+
56+
assert.equal("0", await queuePage.getConsumerCount())
5157
})
5258

53-
after(async function () {
59+
after(async function () {
5460
await teardown(driver, this, captureScreen)
5561
deleteQueue(getManagementUrl(), basicAuthorization("management", "guest"),
5662
"/", queueName)

0 commit comments

Comments
 (0)