Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
79 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { browser, $, element, by, ExpectedConditions as until } from 'protractor'; | ||
import { appHost, checkLogs, checkErrors, testName } from '../protractor.conf'; | ||
import { execSync } from 'child_process'; | ||
|
||
describe('Events', () => { | ||
const name = `${testName}-pod`; | ||
const testpod = { | ||
apiVersion: 'v1', | ||
kind: 'Pod', | ||
metadata: { | ||
name, | ||
namespace: testName, | ||
}, | ||
spec: { | ||
containers: [ | ||
{ | ||
name: 'hello-openshift', | ||
image: 'openshift/hello-openshift', | ||
}, | ||
], | ||
}, | ||
}; | ||
beforeAll(() => { | ||
execSync(`echo '${JSON.stringify(testpod)}' | kubectl create -n ${testName} -f -`); | ||
}); | ||
afterEach(() => { | ||
checkLogs(); | ||
checkErrors(); | ||
}); | ||
afterAll(() => { | ||
try { | ||
execSync(`kubectl delete --cascade pods ${name} -n ${testName}`); | ||
} catch (error) { | ||
console.error(`Failed to delete pods ${name}:\n${error}`); | ||
} | ||
}); | ||
describe('Events', () => { | ||
it('displays Events all resources', async () => { | ||
await browser.get(`${appHost}/k8s/all-namespaces/events`); | ||
await browser.wait(until.presenceOf($('.co-sysevent__box'))); | ||
expect($('.co-sysevent__box').isPresent()).toBe(true); | ||
}); | ||
|
||
it('event view displays created pod', async () => { | ||
await browser.get(`${appHost}/ns/${testName}/events`); | ||
await browser.wait(until.presenceOf($('.co-sysevent-stream__status')), 10000); | ||
await browser.wait(until.presenceOf($('.co-sysevent__box')), 10000); | ||
await browser.wait(until.presenceOf(element(by.linkText(name))), 10000); | ||
await browser.wait(until.presenceOf($(`[data-test-id=${name}]`))); | ||
expect($(`[data-test-id=${name}]`).getText()).toEqual(name); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters