-
Notifications
You must be signed in to change notification settings - Fork 282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix functional tests in services.spec #2781
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,7 +56,9 @@ describe('services screen tests', () => { | |
await browser.switchToWindow(windowHandles[1]); | ||
// verify the URL of the new tab | ||
const url = await browser.getUrl(); | ||
expect(url).toContain('athenz-guide'); | ||
expect( | ||
url.includes('athenz-guide') || url.includes('yo/service-instances') | ||
).toBe(true); | ||
}); | ||
|
||
// after - runs after the last test in order of declaration | ||
|
@@ -82,35 +84,28 @@ describe('services screen tests', () => { | |
await modalDeleteButton.click(); | ||
}); | ||
|
||
describe('services screen tests', () => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. duplicate 'describe' declaration removed, so most of the change here is just indentation fix |
||
it('when clicking "Allow" button on a provider without having appropriate authorisation, the error should be displayed to the right of the button', async () => { | ||
// open browser | ||
await browser.newUser(); | ||
await browser.url(`/`); | ||
|
||
// select domain | ||
let domain = 'athenz.dev.test-non-admin'; | ||
let testDomain = await $(`a*=${domain}`); | ||
await browser.waitUntil(async () => await testDomain.isClickable()); | ||
await testDomain.click(); | ||
it('when clicking "Allow" button on a provider without having appropriate authorisation, the error should be displayed to the right of the button', async () => { | ||
await console.log(`testtesttest inside second test`) | ||
// open browser | ||
await browser.newUser(); | ||
await browser.url(`/domain/athenz.dev.test-non-admin/role`); | ||
Comment on lines
-92
to
+91
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fix of the second test - navigate to domain directly via url, since the user is not its memeber and thus domain is not visible in the list of domains on the right in ui |
||
|
||
// open Services | ||
let servicesDiv = await $('div*=Services'); | ||
await servicesDiv.click(); | ||
// open Services | ||
let servicesDiv = await $('div*=Services'); | ||
await servicesDiv.click(); | ||
|
||
// click Providers | ||
let providersButton = await $(`.//*[local-name()="svg" and @id="provider-test-service-providers"]`); | ||
await providersButton.click(); | ||
// click Providers | ||
let providersButton = await $(`.//*[local-name()="svg" and @id="provider-test-service-providers"]`); | ||
await providersButton.click(); | ||
|
||
// click Azure provider | ||
let awsProviderAllowButton = await $(`td[data-testid="provider-table"]`) | ||
.$(`//td[text()="AWS EC2/EKS/Fargate launches instances for the service"]/following-sibling::td//button`); | ||
await awsProviderAllowButton.click(); | ||
// click Azure provider | ||
let awsProviderAllowButton = await $(`td[data-testid="provider-table"]`) | ||
.$(`//td[text()="AWS EC2/EKS/Fargate launches instances for the service"]/following-sibling::td//button`); | ||
await awsProviderAllowButton.click(); | ||
|
||
// warning should appear | ||
let warning = await $(`td[data-testid="provider-table"]`) | ||
.$(`//td[text()="AWS EC2/EKS/Fargate launches instances for the service"]/following-sibling::td//div[text()="Status: 403. Message: Forbidden"]`); | ||
await expect(warning).toHaveText('Status: 403. Message: Forbidden'); | ||
}); | ||
// warning should appear | ||
let warning = await $(`td[data-testid="provider-table"]`) | ||
.$(`//td[text()="AWS EC2/EKS/Fargate launches instances for the service"]/following-sibling::td//div[text()="Status: 403. Message: Forbidden"]`); | ||
await expect(warning).toHaveText('Status: 403. Message: Forbidden'); | ||
}); | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
url can be either depending on whether the test is run locally or via SD