|
1 |
| -import { stubPlus, stubSystemCrud } from "cypress/support/stubs"; |
| 1 | +import { stubLocations, stubPlus, stubSystemCrud } from "cypress/support/stubs"; |
2 | 2 |
|
3 | 3 | import { INTEGRATION_MANAGEMENT_ROUTE } from "~/features/common/nav/routes";
|
4 | 4 |
|
@@ -435,5 +435,70 @@ describe("Integration management for data detection & discovery", () => {
|
435 | 435 | cy.wait("@putMonitor");
|
436 | 436 | });
|
437 | 437 | });
|
| 438 | + |
| 439 | + describe("data discovery tab for website integration", () => { |
| 440 | + beforeEach(() => { |
| 441 | + stubLocations(); |
| 442 | + cy.intercept("GET", "/api/v1/connection/*", { |
| 443 | + fixture: "connectors/website_integration.json", |
| 444 | + }).as("getWebsiteIntegration"); |
| 445 | + cy.intercept("GET", "/api/v1/plus/discovery-monitor*", { |
| 446 | + fixture: "detection-discovery/monitors/website_monitor_list.json", |
| 447 | + }).as("getMonitors"); |
| 448 | + cy.intercept("GET", "/api/v1/connection_type", { |
| 449 | + fixture: "connectors/connection_types.json", |
| 450 | + }).as("getConnectionTypes"); |
| 451 | + cy.getByTestId("tab-Data discovery").click(); |
| 452 | + cy.wait("@getMonitors"); |
| 453 | + }); |
| 454 | + |
| 455 | + it("should render the website monitor list", () => { |
| 456 | + cy.getByTestId("monitor-description").contains( |
| 457 | + "Configure your website monitor", |
| 458 | + ); |
| 459 | + cy.getByTestId("row-test website monitor-col-name").should( |
| 460 | + "contain", |
| 461 | + "test website monitor", |
| 462 | + ); |
| 463 | + }); |
| 464 | + |
| 465 | + it("should allow creating a website monitor", () => { |
| 466 | + cy.intercept("PUT", "/api/v1/plus/discovery-monitor*", { |
| 467 | + response: 200, |
| 468 | + }).as("putMonitor"); |
| 469 | + cy.getByTestId("add-monitor-btn").click(); |
| 470 | + cy.getByTestId("input-name").type("A new website monitor"); |
| 471 | + cy.getByTestId("input-url") |
| 472 | + .should("be.disabled") |
| 473 | + .and("have.value", "http://example.com"); |
| 474 | + cy.getByTestId( |
| 475 | + "controlled-select-datasource_params.locations", |
| 476 | + ).antSelect("France"); |
| 477 | + cy.getByTestId("controlled-select-execution_frequency").click({ |
| 478 | + force: true, |
| 479 | + }); |
| 480 | + cy.getByTestId("controlled-select-execution_frequency").antSelect( |
| 481 | + "Daily", |
| 482 | + ); |
| 483 | + cy.getByTestId("input-execution_start_date").type("2034-06-03T10:00"); |
| 484 | + cy.getByTestId("save-btn").click(); |
| 485 | + cy.wait("@putMonitor"); |
| 486 | + }); |
| 487 | + |
| 488 | + it("should allow editing a website monitor", () => { |
| 489 | + cy.intercept("PUT", "/api/v1/plus/discovery-monitor*", { |
| 490 | + response: 200, |
| 491 | + }).as("putMonitor"); |
| 492 | + cy.getByTestId("row-test website monitor").click(); |
| 493 | + cy.getByTestId("input-name") |
| 494 | + .should("have.value", "test website monitor") |
| 495 | + .clear() |
| 496 | + .type("A different name"); |
| 497 | + cy.getByTestId("save-btn").click(); |
| 498 | + cy.wait("@putMonitor").then((interception) => { |
| 499 | + expect(interception.request.body.name).to.equal("A different name"); |
| 500 | + }); |
| 501 | + }); |
| 502 | + }); |
438 | 503 | });
|
439 | 504 | });
|
0 commit comments