Skip to content

Commit

Permalink
test: updated test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
tikazyq committed Nov 4, 2024
1 parent e7414be commit 016d5b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
8 changes: 1 addition & 7 deletions fixtures/spiderData.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@
"single": {
"name": "Test Spider",
"description": "This is a test spider",
"project": "Test Project",
"cmd": "python main.py"
},
"create": {
"name": "Create Spider",
"description": "This is a test spider for create",
"project": "Test Project",
"project": "",
"cmd": "python main.py"
}
}
6 changes: 4 additions & 2 deletions page-objects/views/spider/spiderFormPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class SpiderFormPage extends FormPage<Spider> {
private nodeCheckTagGroup = '[data-test="nodes"] .cl-check-tag-group';
private descriptionTextarea = '[data-test="description"] textarea';

async fillForm({name, project, cmd, description}: Spider) {
async fillForm({ name, project, cmd, description }: Spider) {
await this.setName(name);
await this.setProject(project);
await this.setCommand(cmd);
Expand All @@ -25,7 +25,9 @@ export class SpiderFormPage extends FormPage<Spider> {
}

async setProject(project: string) {
await this.selectOptionByText(this.projectSelect, project, this.projectSelectDropdown);
if (project) {
await this.selectOptionByText(this.projectSelect, project, this.projectSelectDropdown);
}
}

async setCommand(cmd: string) {
Expand Down

0 comments on commit 016d5b6

Please sign in to comment.