-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RFR] Archetype association - Application creation before archetype c…
…reation (#904) * Archetype association - Application creation before archetype creation * Moved selectors out Signed-off-by: Nandini Chandra <[email protected]> * Add Polarion TC number Signed-off-by: Nandini Chandra <[email protected]> * Minor changes Signed-off-by: Nandini Chandra <[email protected]> * Minor changes Signed-off-by: Nandini Chandra <[email protected]> * Minor change Signed-off-by: Nandini Chandra <[email protected]> --------- Signed-off-by: Nandini Chandra <[email protected]>
- Loading branch information
Showing
3 changed files
with
83 additions
and
2 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
80 changes: 80 additions & 0 deletions
80
cypress/e2e/tests/migration/applicationinventory/assessment/archetype_association.test.ts
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 |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/* | ||
Copyright © 2021 the Konveyor Contributors (https://konveyor.io/) | ||
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. | ||
*/ | ||
/// <reference types="cypress" /> | ||
|
||
import * as data from "../../../../../utils/data_utils"; | ||
import * as commonView from "../../../../views/common.view"; | ||
import { | ||
click, | ||
login, | ||
createMultipleTags, | ||
deleteByList, | ||
sidedrawerTab, | ||
} from "../../../../../utils/utils"; | ||
import { Application } from "../../../../models/migration/applicationinventory/application"; | ||
import { Archetype } from "../../../../models/migration/archetypes/archetype"; | ||
import { SEC } from "../../../../types/constants"; | ||
import { Tag } from "../../../../models/migration/controls/tags"; | ||
|
||
let applicationList: Array<Application> = []; | ||
let archetypeList: Array<Archetype> = []; | ||
let tags: Tag[]; | ||
|
||
describe(["@tier2"], "Tests related to application-archetype association ", () => { | ||
before("Login", function () { | ||
login(); | ||
tags = createMultipleTags(2); | ||
}); | ||
|
||
it("Archetype association - Application creation before archetype creation ", function () { | ||
// Automates Polarion MTA-400 | ||
const appdata = { | ||
name: data.getAppName(), | ||
description: data.getDescription(), | ||
tags: [tags[0].name], | ||
comment: data.getDescription(), | ||
}; | ||
|
||
const application = new Application(appdata); | ||
applicationList.push(application); | ||
application.create(); | ||
cy.wait(2 * SEC); | ||
|
||
const archetypeList = []; | ||
const archetype = new Archetype( | ||
data.getRandomWord(8), | ||
[tags[0].name], | ||
[tags[1].name], | ||
null | ||
); | ||
archetype.create(); | ||
cy.wait(2 * SEC); | ||
archetypeList.push(archetype); | ||
|
||
// Assert that associated archetypes are listed on app drawer after application gets associated with archetype(s) | ||
Application.open(); | ||
sidedrawerTab(application.name, "Details"); | ||
cy.get(commonView.sideDrawer.associatedArchetypes).contains("Associated archetypes"); | ||
cy.get(commonView.sideDrawer.labelContent).contains(archetype.name); | ||
click(commonView.sideDrawer.closeDrawer); | ||
}); | ||
|
||
after("Perform test data clean up", function () { | ||
deleteByList(applicationList); | ||
deleteByList(archetypeList); | ||
deleteByList(tags); | ||
}); | ||
}); |
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