Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1856622: Add integration test for vm scheduling
- Loading branch information
Showing
12 changed files
with
306 additions
and
237 deletions.
There are no files selected for viewing
39 changes: 0 additions & 39 deletions
39
frontend/packages/kubevirt-plugin/integration-tests/tests/dialogs/nodeSelectorDialog.ts
This file was deleted.
Oops, something went wrong.
49 changes: 49 additions & 0 deletions
49
frontend/packages/kubevirt-plugin/integration-tests/tests/dialogs/schedulingDialog.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,49 @@ | ||
/* eslint-disable no-await-in-loop */ | ||
import * as view from '../../views/dialogs/editLabelView'; | ||
import { asyncForEach, click, fillInput } from '@console/shared/src/test-utils/utils'; | ||
import { MatchLabels } from '@console/internal/module/k8s'; | ||
|
||
export class AddDialog { | ||
private extractID(id: string) { | ||
return id.split('-')[1]; | ||
} | ||
|
||
/** | ||
* Adds new row if needed. | ||
* Returns string with index of next empty row. | ||
*/ | ||
async addRow(placeholder: string): Promise<string> { | ||
if ((await view.emptyKeyInputs(placeholder).count()) === 0) { | ||
await click(view.addLabelBtn); | ||
} | ||
return this.extractID( | ||
await view | ||
.emptyKeyInputs(placeholder) | ||
.first() | ||
.getAttribute('id'), | ||
); | ||
} | ||
|
||
async addLabel(name: string, placeholder: string, key: string, value: string) { | ||
const id = await this.addRow(placeholder); | ||
await fillInput(view.keyInputByID(name, id), key); | ||
await fillInput(view.valueInputByID(name, id), value); | ||
} | ||
|
||
async addLabels(name: string, placeholder: string, labels: MatchLabels) { | ||
for (const [key, value] of Object.entries(labels)) { | ||
await this.addLabel(name, placeholder, key, value); | ||
} | ||
} | ||
|
||
async deleteLabel(name: string, placeholder: string, value: string) { | ||
const id = this.extractID(await view.keyInputByKey(placeholder, value).getAttribute('id')); | ||
await click(view.deleteBtnByID(name, id)); | ||
} | ||
|
||
async deleteLabels(name: string, placeholder: string, labels: MatchLabels) { | ||
return asyncForEach(Object.keys(labels), async (key: string) => { | ||
await this.deleteLabel(name, placeholder, key); | ||
}); | ||
} | ||
} |
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
58 changes: 0 additions & 58 deletions
58
frontend/packages/kubevirt-plugin/integration-tests/tests/vm.detail.affinity.scenario.ts
This file was deleted.
Oops, something went wrong.
53 changes: 0 additions & 53 deletions
53
...tend/packages/kubevirt-plugin/integration-tests/tests/vm.detail.node-selector.scenario.ts
This file was deleted.
Oops, something went wrong.
53 changes: 0 additions & 53 deletions
53
frontend/packages/kubevirt-plugin/integration-tests/tests/vm.detail.tolerations.scenario.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.