2020-05-26 03:30:55 +01:00
|
|
|
// 1. Click on "New Container" on the command bar.
|
|
|
|
// 2. Pane with the title "Add Container" should appear on the right side of the screen
|
|
|
|
// 3. It includes an input box for the database Id.
|
|
|
|
// 4. It includes a checkbox called "Create now".
|
|
|
|
// 5. When the checkbox is marked, enter new database id.
|
|
|
|
// 3. Create a database WITH "Provision throughput" checked.
|
|
|
|
// 4. Enter minimum throughput value of 400.
|
|
|
|
// 5. Enter container id to the container id text box.
|
|
|
|
// 6. Enter partition key to the partition key text box.
|
|
|
|
// 7. Click "OK" to create a new container.
|
|
|
|
// 8. Verify the new container is created along with the database id and should appead in the Data Explorer list in the left side of the screen.
|
|
|
|
|
|
|
|
const connectionString = require("../../../utilities/connectionString");
|
|
|
|
|
|
|
|
let crypt = require("crypto");
|
|
|
|
|
|
|
|
context("SQL API Test", () => {
|
|
|
|
beforeEach(() => {
|
2020-06-15 17:25:59 +01:00
|
|
|
connectionString.loginUsingConnectionString();
|
2020-05-26 03:30:55 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
it("Create a new container in SQL API", () => {
|
|
|
|
const dbId = `TestDatabase${crypt.randomBytes(8).toString("hex")}`;
|
|
|
|
const collectionId = `TestCollection${crypt.randomBytes(8).toString("hex")}`;
|
|
|
|
const sharedKey = `SharedKey${crypt.randomBytes(8).toString("hex")}`;
|
2020-06-15 17:25:59 +01:00
|
|
|
connectionString.loginUsingConnectionString();
|
2020-05-26 03:30:55 +01:00
|
|
|
|
2020-07-02 05:33:09 +01:00
|
|
|
cy.get("iframe").then(($element) => {
|
2020-05-26 03:30:55 +01:00
|
|
|
const $body = $element.contents().find("body");
|
|
|
|
cy.wrap($body)
|
|
|
|
.find('div[class="commandBarContainer"]')
|
|
|
|
.should("be.visible")
|
|
|
|
.find('button[data-test="New Container"]')
|
|
|
|
.should("be.visible")
|
|
|
|
.click();
|
|
|
|
|
2020-07-02 05:33:09 +01:00
|
|
|
cy.wrap($body).find('div[class="contextual-pane-in"]').should("be.visible").find('span[id="containerTitle"]');
|
2020-05-26 03:30:55 +01:00
|
|
|
|
2020-07-02 05:33:09 +01:00
|
|
|
cy.wrap($body).find('input[data-test="addCollection-createNewDatabase"]').check();
|
2020-05-26 03:30:55 +01:00
|
|
|
|
2020-07-02 05:33:09 +01:00
|
|
|
cy.wrap($body).find('input[data-test="addCollectionPane-databaseSharedThroughput"]').check();
|
2020-05-26 03:30:55 +01:00
|
|
|
|
2020-07-02 05:33:09 +01:00
|
|
|
cy.wrap($body).find('input[data-test="addCollection-newDatabaseId"]').type(dbId);
|
2020-05-26 03:30:55 +01:00
|
|
|
|
2020-07-02 05:33:09 +01:00
|
|
|
cy.wrap($body).find('input[data-test="addCollection-collectionId"]').type(collectionId);
|
2020-05-26 03:30:55 +01:00
|
|
|
|
2020-07-02 05:33:09 +01:00
|
|
|
cy.wrap($body).find('input[data-test="databaseThroughputValue"]').should("have.value", "400");
|
2020-05-26 03:30:55 +01:00
|
|
|
|
2020-07-02 05:33:09 +01:00
|
|
|
cy.wrap($body).find('input[data-test="addCollection-partitionKeyValue"]').type(sharedKey);
|
2020-05-26 03:30:55 +01:00
|
|
|
|
2020-07-02 05:33:09 +01:00
|
|
|
cy.wrap($body).find("#submitBtnAddCollection").click();
|
2020-05-26 03:30:55 +01:00
|
|
|
|
|
|
|
cy.wait(10000);
|
|
|
|
|
|
|
|
cy.wrap($body)
|
|
|
|
.find('div[data-test="resourceTreeId"]')
|
|
|
|
.should("exist")
|
|
|
|
.find('div[class="treeComponent dataResourceTree"]')
|
|
|
|
.should("contain", dbId);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|