forked from evergreen-ci/spruce
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EVG-19946: Support Docker on provider settings page (evergreen-ci#2017)
- Loading branch information
Showing
18 changed files
with
534 additions
and
188 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
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,86 @@ | ||
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"); | ||
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); | ||
}); | ||
// Correct section is displayed. | ||
cy.dataCy("static-provider-settings").should("exist"); | ||
|
||
cy.getInputByLabel("User Data").type("my user data"); | ||
cy.getInputByLabel("Merge with existing user data").check({ | ||
force: true, | ||
// Change field values. | ||
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"); | ||
|
||
// Revert fields to original values. | ||
cy.getInputByLabel("User Data").clear(); | ||
cy.getInputByLabel("Merge with existing user data").uncheck({ | ||
force: true, | ||
}); | ||
cy.dataCy("delete-item-button").click(); | ||
save(); | ||
cy.validateToast("success"); | ||
}); | ||
cy.contains("button", "Add security group").click(); | ||
cy.getInputByLabel("Security Group ID").type("group-1234"); | ||
}); | ||
|
||
save(); | ||
cy.validateToast("success"); | ||
describe("docker", () => { | ||
beforeEach(() => { | ||
cy.visit("/distro/ubuntu1604-container-test/settings/provider"); | ||
}); | ||
|
||
cy.getInputByLabel("User Data").clear(); | ||
cy.getInputByLabel("Merge with existing user data").uncheck({ | ||
force: true, | ||
it("shows pool mapping information based on container pool id", () => { | ||
cy.getInputByLabel("Container Pool ID").should( | ||
"contain.text", | ||
"test-pool-1" | ||
); | ||
cy.getInputByLabel("Pool Mapping Information") | ||
.should("have.attr", "placeholder") | ||
.and("match", /test-pool-1/); | ||
cy.selectLGOption("Container Pool ID", "test-pool-2"); | ||
cy.getInputByLabel("Pool Mapping Information") | ||
.should("have.attr", "placeholder") | ||
.and("match", /test-pool-2/); | ||
}); | ||
cy.dataCy("delete-item-button").click(); | ||
|
||
save(); | ||
cy.validateToast("success"); | ||
it("successfully updates docker provider fields", () => { | ||
cy.dataCy("provider-select").contains("Docker"); | ||
|
||
// Correct section is displayed. | ||
cy.dataCy("docker-provider-settings").should("exist"); | ||
|
||
// Change field values. | ||
cy.selectLGOption("Image Build Method", "Pull"); | ||
cy.selectLGOption("Container Pool ID", "test-pool-2"); | ||
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"); | ||
|
||
// Revert fields to original values. | ||
cy.selectLGOption("Image Build Method", "Import"); | ||
cy.selectLGOption("Container Pool ID", "test-pool-1"); | ||
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
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.