Skip to content

Commit

Permalink
KOGITO-5428: Introduce DMN Runner cypress test
Browse files Browse the repository at this point in the history
  • Loading branch information
Jozef Marko committed Sep 13, 2021
1 parent 580f4d0 commit 735b2a4
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
40 changes: 40 additions & 0 deletions packages/online-editor/it-tests/integration/DMNRunnerTest.ts
@@ -0,0 +1,40 @@
/*
* Copyright 2021 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import * as buildEnv from "@kogito-tooling/build-env";

describe("DMN Runner Test", () => {
beforeEach(() => {
cy.visit(`http://localhost:${buildEnv.onlineEditor.dev.port}/`);
});

it("set up DMN Runner", () => {
// click Create new decision model button (new DMN)
cy.get("[data-ouia-component-id='new-dmn-button']").click();

// wait until loading dialog disappears
cy.loadEditor();

// check editor logo
cy.get("[class='pf-c-brand']").within(($logo) => {
expect($logo.attr("src")).contain("dmn");
expect($logo.attr("alt")).contain("dmn");
});

// start the DMN Runner set up
cy.get("[data-ouia-component-id='dmn-guided-tour'] button").contains("Skip tour and start DMN Runner").click();
});
});
3 changes: 2 additions & 1 deletion packages/online-editor/package.json
Expand Up @@ -37,7 +37,8 @@
"start": "webpack serve --host 0.0.0.0 --env dev",
"cy:open": "yarn run cypress open --project it-tests",
"cy:run": "yarn run cypress run -b chrome --project it-tests",
"test:it": "yarn run run-script-if --bool \"$(build-env global.build.testIT)\" --then \"yarn rimraf ./dist-it-tests\" \"yarn run start-server-and-test start http-get://0.0.0.0:$(build-env onlineEditor.dev.port) cy:run\""
"test:it": "yarn start-server-and-test ../extended-services/dist/linux/kie_tooling_extended_services http-get://0.0.0.0:21345/ping test:it:main",
"test:it:main": "yarn run run-script-if --bool \"$(build-env global.build.testIT)\" --then \"yarn rimraf ./dist-it-tests\" \"yarn run start-server-and-test start http-get://0.0.0.0:$(build-env onlineEditor.dev.port) cy:run\""
},
"babel": {
"presets": [
Expand Down
Expand Up @@ -651,6 +651,7 @@ export function KieToolingExtendedServicesModal() {

return (
<Modal
ouiaId="kie-tooling-extended-services-modal"
isOpen={kieToolingExtendedServices.isModalOpen}
onClose={onClose}
variant={modalVariant}
Expand Down

0 comments on commit 735b2a4

Please sign in to comment.