This repository has been archived by the owner on Jul 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EVG-19946: Add Docker to provider settings page
- Loading branch information
Showing
12 changed files
with
526 additions
and
115 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,88 @@ | ||
import { save } from "./utils"; | ||
|
||
describe("provider section", () => { | ||
beforeEach(() => { | ||
cy.visit("/distro/localhost/settings/provider"); | ||
}); | ||
describe("static", () => { | ||
beforeEach(() => { | ||
cy.visit("/distro/localhost/settings/provider"); | ||
}); | ||
|
||
it("successfully updates static provider fields", () => { | ||
cy.dataCy("provider-select").contains("Static IP/VM"); | ||
|
||
// Correct fields are displayed | ||
cy.dataCy("provider-settings").within(() => { | ||
cy.get("button").should("have.length", 1); | ||
cy.get("textarea").should("have.length", 1); | ||
cy.get("input[type=checkbox]").should("have.length", 1); | ||
cy.get("input[type=text]").should("have.length", 0); | ||
}); | ||
|
||
cy.getInputByLabel("User Data").type("my user data"); | ||
cy.getInputByLabel("Merge with existing user data").check({ | ||
force: true, | ||
}); | ||
cy.contains("button", "Add security group").click(); | ||
cy.getInputByLabel("Security Group ID").type("group-1234"); | ||
|
||
save(); | ||
cy.validateToast("success"); | ||
|
||
it("successfully updates static provider fields", () => { | ||
cy.dataCy("provider-select").contains("Static IP/VM"); | ||
cy.getInputByLabel("User Data").clear(); | ||
cy.getInputByLabel("Merge with existing user data").uncheck({ | ||
force: true, | ||
}); | ||
cy.dataCy("delete-item-button").click(); | ||
|
||
// Correct fields are displayed | ||
cy.dataCy("provider-settings").within(() => { | ||
cy.get("button").should("have.length", 1); | ||
cy.get("textarea").should("have.length", 1); | ||
cy.get("input[type=checkbox]").should("have.length", 1); | ||
cy.get("input[type=text]").should("have.length", 0); | ||
save(); | ||
cy.validateToast("success"); | ||
}); | ||
}); | ||
|
||
cy.getInputByLabel("User Data").type("my user data"); | ||
cy.getInputByLabel("Merge with existing user data").check({ | ||
force: true, | ||
describe.only("docker", () => { | ||
beforeEach(() => { | ||
cy.visit("/distro/ubuntu1604-container-test/settings/provider"); | ||
}); | ||
cy.contains("button", "Add security group").click(); | ||
cy.getInputByLabel("Security Group ID").type("group-1234"); | ||
|
||
save(); | ||
cy.validateToast("success"); | ||
it("successfully updates docker provider fields", () => { | ||
cy.dataCy("provider-select").contains("Docker"); | ||
|
||
cy.getInputByLabel("User Data").clear(); | ||
cy.getInputByLabel("Merge with existing user data").uncheck({ | ||
force: true, | ||
}); | ||
cy.dataCy("delete-item-button").click(); | ||
// Correct fields are displayed | ||
cy.dataCy("provider-settings").within(() => { | ||
cy.getInputByLabel("Docker Image URL").should("exist"); | ||
cy.getInputByLabel("Image Build Method").should("exist"); | ||
cy.getInputByLabel("Username for Registries").should("exist"); | ||
cy.getInputByLabel("Password for Registries").should("exist"); | ||
cy.getInputByLabel("Container Pool ID").should("exist"); | ||
cy.getInputByLabel("Pool Mapping Information").should("exist"); | ||
cy.getInputByLabel("User Data").should("exist"); | ||
cy.getInputByLabel("Merge with existing user data").should("exist"); | ||
cy.contains("button", "Add security group").should("exist"); | ||
}); | ||
|
||
// Change field values. | ||
cy.selectLGOption("Image Build Method", "Pull"); | ||
cy.selectLGOption("Container Pool ID", /^test-pool$/); | ||
cy.getInputByLabel("Username for Registries").type("username"); | ||
cy.getInputByLabel("Password for Registries").type("password"); | ||
cy.getInputByLabel("User Data").type("my user data"); | ||
cy.getInputByLabel("Merge with existing user data").check({ | ||
force: true, | ||
}); | ||
save(); | ||
cy.validateToast("success"); | ||
|
||
save(); | ||
cy.validateToast("success"); | ||
// Revert fields to original values. | ||
cy.selectLGOption("Image Build Method", "Import"); | ||
cy.selectLGOption("Container Pool ID", "ubuntu-test-pool"); | ||
cy.getInputByLabel("Username for Registries").clear(); | ||
cy.getInputByLabel("Password for Registries").clear(); | ||
cy.getInputByLabel("User Data").clear(); | ||
cy.getInputByLabel("Merge with existing user data").uncheck({ | ||
force: true, | ||
}); | ||
|
||
save(); | ||
cy.validateToast("success"); | ||
}); | ||
}); | ||
}); |
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
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.