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
Radim Hrazdil
committed
Jul 10, 2020
1 parent
138b518
commit 2babadf
Showing
69 changed files
with
1,625 additions
and
1,173 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
28 changes: 18 additions & 10 deletions
28
...end/packages/kubevirt-plugin/integration-tests/tests/dialogs/cloneVirtualMachineDialog.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 |
---|---|---|
@@ -1,33 +1,41 @@ | ||
import { browser, ExpectedConditions as until } from 'protractor'; | ||
import { click, fillInput } from '@console/shared/src/test-utils/utils'; | ||
import { selectOptionByText } from '../utils/utils'; | ||
import { PAGE_LOAD_TIMEOUT_SECS } from '../utils/consts'; | ||
import * as cloneDialogView from '../../views/dialogs/cloneVirtualMachineDialog.view'; | ||
import { PAGE_LOAD_TIMEOUT_SECS, SEC } from '../utils/constants/common'; | ||
import * as view from '../../views/dialogs/cloneVirtualMachineDialog.view'; | ||
|
||
export class CloneVirtualMachineDialog { | ||
async close() { | ||
await click(cloneDialogView.cancelButton); | ||
await browser.wait(until.invisibilityOf(cloneDialogView.modalDialog), PAGE_LOAD_TIMEOUT_SECS); | ||
await click(view.cancelButton); | ||
await browser.wait(until.invisibilityOf(view.modalDialog), PAGE_LOAD_TIMEOUT_SECS); | ||
} | ||
|
||
async fillName(name: string) { | ||
await fillInput(cloneDialogView.nameInput, name); | ||
await fillInput(view.nameInput, name); | ||
} | ||
|
||
async fillDescription(description: string) { | ||
await fillInput(cloneDialogView.descriptionInput, description); | ||
await fillInput(view.descriptionInput, description); | ||
} | ||
|
||
async selectNamespace(namespace: string) { | ||
await selectOptionByText(cloneDialogView.namespaceSelector, namespace); | ||
await selectOptionByText(view.namespaceSelector, namespace); | ||
} | ||
|
||
async startOnCreation() { | ||
await click(cloneDialogView.startOnCreationCheckBox); | ||
await click(view.startOnCreationCheckBox); | ||
} | ||
|
||
async clone() { | ||
await click(cloneDialogView.confirmButton); | ||
await browser.wait(until.invisibilityOf(cloneDialogView.modalDialog), PAGE_LOAD_TIMEOUT_SECS); | ||
try { | ||
await browser.wait(until.presenceOf(view.errorHelper), 1 * SEC); | ||
} catch (e) { | ||
// error wasn't displayed, everything is OK | ||
await click(view.confirmButton); | ||
await browser.wait(until.invisibilityOf(view.modalDialog), PAGE_LOAD_TIMEOUT_SECS); | ||
return; | ||
} | ||
// An error is displayed | ||
throw new Error(await view.errorHelper.getText()); | ||
} | ||
} |
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
4 changes: 2 additions & 2 deletions
4
frontend/packages/kubevirt-plugin/integration-tests/tests/example.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
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
Oops, something went wrong.