Skip to content

Commit

Permalink
[RFR] Automate TC-583 (#1198)
Browse files Browse the repository at this point in the history
* initial commit

Signed-off-by: midays <[email protected]>

* change the test structure to be dynamic

Signed-off-by: midays <[email protected]>

* Added comment

Signed-off-by: midays <[email protected]>

* npm run format

Signed-off-by: midays <[email protected]>

---------

Signed-off-by: midays <[email protected]>
  • Loading branch information
midays authored Aug 21, 2024
1 parent b17e202 commit adea03c
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
import { Application } from "../../../../models/migration/applicationinventory/application";
import { SEC } from "../../../../types/constants";
import { labelTagText } from "../../../../views/applicationinventory.view";
import { languageDiscoveryData } from "../../../../../fixtures/language_discovery.json";

let applicationList: Application[] = [];

Expand All @@ -32,50 +33,26 @@ describe(["@tier2"], "Test if application language is discovered and tagged corr
login();
});

beforeEach("Load Data", function () {
cy.fixture("application").then(function (appData) {
this.appData = appData;
});
});

it("Application written in java with maven tooling and quarkus framework", function () {
// Automates Polarion MTA-586
languageDiscoveryData.forEach((data) => {
it(`test ${data.name.split("-").join(" ")}`, function () {
// Automates TCs 582, 583, 584, 585, 585, 586, 587

const sectionsTags = {
Language: ["Java"],
Tooling: ["Maven"],
Framework: ["Quarkus"],
};
const application = new Application(
getRandomApplicationData("Java_language_maven_tooling_quarkus_framework", {
sourceData: this.appData["Java_language_maven_tooling_quarkus_framework"],
})
);
application.create();
applicationList.push(application);
cy.wait(2 * SEC);
sidedrawerTab("Java_language_maven_tooling_quarkus_framework", "Tags");
cy.contains("No tags available", { timeout: 60 * SEC }).should("not.exist");
assertTagsInSection(sectionsTags);
});

it("Application written in java and typescript with Maven and NodeJS tooling ", function () {
// Automates Polarion MTA-582
const sectionsTags = {
Language: ["Java", "TypeScript"],
Tooling: ["Maven", "NodeJs", "Node.js"],
};
const application = new Application(
getRandomApplicationData("Java_TS_language_maven_nodeJS_tooling", {
sourceData: this.appData["Java_TS_language_maven_nodeJS_tooling"],
})
);
application.create();
applicationList.push(application);
cy.wait(2 * SEC);
sidedrawerTab("Java_TS_language_maven_nodeJS_tooling", "Tags");
cy.contains("No tags available", { timeout: 60 * SEC }).should("not.exist");
assertTagsInSection(sectionsTags);
const sectionsTags = data.sections_tags;
const application = new Application(
getRandomApplicationData(data.name, {
sourceData: {
repoType: data.repoType,
sourceRepo: data.sourceRepo,
},
})
);
application.create();
applicationList.push(application);
cy.wait(2 * SEC);
sidedrawerTab(data.name, "Tags");
cy.contains("No tags available", { timeout: 60 * SEC }).should("not.exist");
assertTagsInSection(sectionsTags);
});
});

afterEach("Persist session", function () {
Expand Down
8 changes: 0 additions & 8 deletions cypress/fixtures/application.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,6 @@
"sourceRepo": "https://github.com/konveyor/tackle-testapp-public",
"branch": "feature/test-java9-removed-packagek"
},
"Java_language_maven_tooling_quarkus_framework": {
"repoType": "Git",
"sourceRepo": "https://github.com/quarkusio/quarkus-super-heroes"
},
"Java_TS_language_maven_nodeJS_tooling": {
"repoType": "Git",
"sourceRepo": "https://github.com/pkaul/maven-typescript-example"
},
"java-example-app": {
"repoType": "Git",
"sourceRepo": "https://github.com/ibraginsky/book-server"
Expand Down
61 changes: 61 additions & 0 deletions cypress/fixtures/language_discovery.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"languageDiscoveryData": [
{
"name": "java-language-maven-tooling-quarkus-framework",
"repoType": "Git",
"sourceRepo": "https://github.com/quarkusio/quarkus-super-heroes",
"sections_tags": {
"Language": ["Java"],
"Tooling": ["Maven"],
"Framework": ["Quarkus"]
}
},
{
"name": "java-ts-language-maven-nodeJS-tooling",
"repoType": "Git",
"sourceRepo": "https://github.com/pkaul/maven-typescript-example",
"sections_tags": {
"Language": ["Java", "TypeScript"],
"Tooling": ["Maven", "NodeJs", "Node.js"]
}
},
{
"name": "go-language-gin-framework",
"repoType": "Git",
"sourceRepo": "https://github.com/gothinkster/golang-gin-realworld-example-app",
"sections_tags": {
"Language": ["Go"],
"Framework": ["Gin"]
}
},
{
"name": "python-language-django-framework",
"repoType": "Git",
"sourceRepo": "https://github.com/Shopify/sample-django-app",
"sections_tags": {
"Language": ["Python"],
"Framework": ["Django"]
}
},
{
"name": "typescript-language-nodeJS-tooling-react-framework",
"repoType": "Git",
"sourceRepo": "https://github.com/CodelyTV/awesome-typescript-examples",
"sections_tags": {
"Language": ["TypeScript", "JavaScript"],
"Tooling": ["NodeJs", "Node.js"],
"Framework": ["React", "Express"]
}
},
{
"name": "java-Batchfile-languages-maven-tooling-spring+boot-framework",
"repoType": "Git",
"sourceRepo": "https://github.com/kirillesau/spring-demo-application",
"sections_tags": {
"Language": ["Java", "Batchfile"],
"Tooling": ["Maven"],
"Framework": ["Spring", "Spring Boot"]
}
}
]
}

0 comments on commit adea03c

Please sign in to comment.