Skip to content

Commit

Permalink
Reviewed test create consumer group and check dashboard (redhat-devel…
Browse files Browse the repository at this point in the history
…oper#69)

* Reviewed test create consumer group and check dashboard

* UPDATE: revert Consumer Groups Tab locator to TestID

UPDATE: revert Consumer Groups Tab locator to TestID

* Add Billing tests (redhat-developer#62)

* WIP: new billing tests

Signed-off-by: Jakub Stejskal <xstejs24@gmail.com>

* Add billing tests

Signed-off-by: Jakub Stejskal <xstejs24@gmail.com>

* Remove unused log

Signed-off-by: Jakub Stejskal <xstejs24@gmail.com>

* Remove unnecessary switch

Signed-off-by: Jakub Stejskal <xstejs24@gmail.com>

Signed-off-by: Jakub Stejskal <xstejs24@gmail.com>

* Reviewed test create consumer group and check dashboard

* UPDATE: revert Consumer Groups Tab locator to TestID

UPDATE: revert Consumer Groups Tab locator to TestID

* UPDATE: changed ConsumerGroups locator to text

* ran prettier

* ran prettier

* UPDATE: added retry mechanism to Consumer

Signed-off-by: Jakub Stejskal <xstejs24@gmail.com>
Co-authored-by: Jakub Stejskal <xstejs24@gmail.com>
  • Loading branch information
asanzgom and Frawless authored Jan 11, 2023
1 parent 7af7016 commit 95d1087
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/kafka.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export const navigateToAccess = async function (page: Page, kafkaName: string) {
};

export const navigateToConsumerGroups = async function (page: Page) {
await page.getByTestId('pageKafka-tabConsumers').click();
await page.click('text=Consumer groups');
};

export const showElementActions = async function (page: Page, instanceName: string) {
Expand Down
34 changes: 33 additions & 1 deletion tests/kas_messaging.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import {
navigateToAccess,
navigateToConsumerGroups,
grantProducerAccess,
grantConsumerAccess
grantConsumerAccess,
waitForKafkaReady
} from '@lib/kafka';
import { navigateToKafkaTopicsList, createKafkaTopic, navigateToMessages, refreshMessages } from '@lib/topic';
import { KafkaConsumer, KafkaProducer } from '@lib/clients';
Expand Down Expand Up @@ -201,3 +202,34 @@ for (const filter of filters) {
}
});
}
// test_6acl.py test_kafka_create_consumer_group_and_check_dashboard
test('create consumer group and check dashboard', async ({ page }) => {
const instanceLinkSelector = page.getByText(testInstanceName);
const row = page.locator('tr', { has: instanceLinkSelector });

await navigateToKafkaList(page);
await waitForKafkaReady(page, testInstanceName);
await row.locator('[aria-label="Actions"]').click();
await page.getByText('Connection').click();

const bootstrapUrl = await getBootstrapUrl(page, testInstanceName);
console.log('bootstrapUrl: ' + bootstrapUrl);

// Consumer
await navigateToAccess(page, testInstanceName);
await grantConsumerAccess(page, credentials.clientID, testTopicName, consumerGroupId);
const consumer = new KafkaConsumer(bootstrapUrl, consumerGroupId, credentials.clientID, credentials.clientSecret);
const consumerResponse = await retry(
() => consumer.consumeMessages(testTopicName, expectedMessageCount),
reconnectCount,
reconnectDelayMs
);
expect(consumerResponse).toEqual(expectedMessageCount);

// Open Consumer Groups Tab to check dashboard
await navigateToConsumerGroups(page);
await expect(page.getByText(consumerGroupId)).toHaveCount(1);

await navigateToSAList(page);
await deleteServiceAccount(page, testServiceAccountName);
});

0 comments on commit 95d1087

Please sign in to comment.