-
Notifications
You must be signed in to change notification settings - Fork 593
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add integration test for node-selector modal
- Loading branch information
Gilad Lekner
authored and
Gilad Lekner
committed
May 4, 2020
1 parent
6ae5639
commit 82c7f01
Showing
7 changed files
with
82 additions
and
7 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
52 changes: 52 additions & 0 deletions
52
...tend/packages/kubevirt-plugin/integration-tests/tests/vm.detail.node-selector.scenario.ts
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,52 @@ | ||
import { browser, ExpectedConditions as until } from 'protractor'; | ||
import { testName } from '@console/internal-integration-tests/protractor.conf'; | ||
import { createResource, deleteResource, click } from '@console/shared/src/test-utils/utils'; | ||
import * as editNodeSelectorView from '../views/editNodeSelectorView'; | ||
import * as virtualMachineView from '../views/virtualMachine.view'; | ||
import { VM_CREATE_AND_EDIT_TIMEOUT_SECS } from './utils/consts'; | ||
import { VirtualMachine } from './models/virtualMachine'; | ||
import { getVMManifest } from './utils/mocks'; | ||
import { getRandStr } from './utils/utils'; | ||
|
||
describe('KubeVirt VM detail - edit Node Selector', () => { | ||
const testVM = getVMManifest('Container', testName, `node-selector-vm-${getRandStr(5)}`); | ||
const vm = new VirtualMachine(testVM.metadata); | ||
|
||
beforeAll(async () => { | ||
createResource(testVM); | ||
}); | ||
|
||
afterAll(() => { | ||
deleteResource(testVM); | ||
}); | ||
|
||
it( | ||
'ID(CNV-4133) Adds a Node Selector, then removes it', | ||
async () => { | ||
await vm.navigateToDetail(); | ||
await vm.modalEditNodeSelector(); | ||
await click(editNodeSelectorView.addLabelBtn); | ||
await editNodeSelectorView.labelKeyInputByID(0).sendKeys('key'); | ||
await editNodeSelectorView.labelValueInputByID(0).sendKeys('value'); | ||
await click(editNodeSelectorView.submitBtn); | ||
|
||
await browser.wait( | ||
until.textToBePresentInElement( | ||
virtualMachineView.vmDetailNodeSelector(vm.namespace, vm.name), | ||
'key=value', | ||
), | ||
); | ||
|
||
await vm.modalEditNodeSelector(); | ||
await click(editNodeSelectorView.deleteBtnByID(0)); | ||
await click(editNodeSelectorView.submitBtn); | ||
await browser.wait( | ||
until.textToBePresentInElement( | ||
virtualMachineView.vmDetailNodeSelector(vm.namespace, vm.name), | ||
'No selector', | ||
), | ||
); | ||
}, | ||
VM_CREATE_AND_EDIT_TIMEOUT_SECS, | ||
); | ||
}); |
8 changes: 8 additions & 0 deletions
8
frontend/packages/kubevirt-plugin/integration-tests/views/editNodeSelectorView.ts
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,8 @@ | ||
import { $ } from 'protractor'; | ||
|
||
export const modalTitle = $('[data-test-id="modal-title"]'); | ||
export const addLabelBtn = $('#vm-labels-list-add-btn'); | ||
export const submitBtn = $('#node-selector-submit'); | ||
export const labelKeyInputByID = (id) => $(`#label-${id}-key-input`); | ||
export const labelValueInputByID = (id) => $(`#label-${id}-value-input`); | ||
export const deleteBtnByID = (id) => $(`#label-${id}-delete-btn`); |
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
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