mirror of
https://github.com/datahub-project/datahub.git
synced 2025-09-26 17:45:30 +00:00
fix(cypress): fix cypress test failure updating source (#14517)
This commit is contained in:
parent
f4cfed9e6d
commit
3ffa7aa8f2
@ -1,30 +1,50 @@
|
|||||||
function readyToTypeEditor() {
|
function clearMonacoEditor() {
|
||||||
return cy.get(".monaco-scrollable-element").first().click().focused();
|
const selectAllKey = Cypress.platform === "darwin" ? "{cmd}a" : "{ctrl}a";
|
||||||
|
return cy
|
||||||
|
.get(".monaco-scrollable-element")
|
||||||
|
.first()
|
||||||
|
.click()
|
||||||
|
.focused()
|
||||||
|
.type(selectAllKey)
|
||||||
|
.type("{backspace}");
|
||||||
|
}
|
||||||
|
|
||||||
|
function typeInMonacoEditor(text) {
|
||||||
|
return cy
|
||||||
|
.get(".monaco-scrollable-element")
|
||||||
|
.first()
|
||||||
|
.click()
|
||||||
|
.focused()
|
||||||
|
.type(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
describe("run managed ingestion", () => {
|
describe("run managed ingestion", () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.setIsThemeV2Enabled(true);
|
cy.setIsThemeV2Enabled(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("create run managed ingestion source", () => {
|
it("create run managed ingestion source", () => {
|
||||||
const number = Math.floor(Math.random() * 100000);
|
const number = Math.floor(Math.random() * 100000);
|
||||||
const testName = `cypress test source ${number}`;
|
const testName = `cypress test source ${number}`;
|
||||||
const cli_version = "0.12.0";
|
const cli_version = "0.12.0";
|
||||||
|
|
||||||
cy.login();
|
cy.login();
|
||||||
cy.goToIngestionPage();
|
cy.goToIngestionPage();
|
||||||
cy.contains("Loading ingestion sources...").should("not.exist");
|
cy.contains("Loading ingestion sources...").should("not.exist");
|
||||||
// cy.clickOptionWithText("Create new source");
|
|
||||||
cy.clickOptionWithTestId("create-ingestion-source-button");
|
cy.clickOptionWithTestId("create-ingestion-source-button");
|
||||||
cy.get('[placeholder="Search data sources..."]').type("other");
|
cy.get('[placeholder="Search data sources..."]').type("other");
|
||||||
cy.clickOptionWithTextToScrollintoView("Other");
|
cy.clickOptionWithTextToScrollintoView("Other");
|
||||||
|
|
||||||
cy.waitTextVisible("source-type");
|
cy.waitTextVisible("source-type");
|
||||||
readyToTypeEditor().type("{ctrl}a").clear();
|
|
||||||
readyToTypeEditor().type("source:{enter}");
|
// Clear the editor first
|
||||||
readyToTypeEditor().type(" type: demo-data");
|
clearMonacoEditor();
|
||||||
readyToTypeEditor().type("{enter}");
|
|
||||||
// no space because the editor starts new line at same indentation
|
// Type your content
|
||||||
readyToTypeEditor().type("config: {}");
|
typeInMonacoEditor("source:{enter}");
|
||||||
|
typeInMonacoEditor(" type: demo-data{enter}");
|
||||||
|
typeInMonacoEditor("config: {}");
|
||||||
|
|
||||||
cy.clickOptionWithText("Next");
|
cy.clickOptionWithText("Next");
|
||||||
cy.clickOptionWithText("Next");
|
cy.clickOptionWithText("Next");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user