Skip to content

Commit

Permalink
fix: korjaa automaattitestien sisäänkirjautumisongelma (#300)
Browse files Browse the repository at this point in the history
  • Loading branch information
haapamakim authored Jul 8, 2022
1 parent a85262f commit 39164ea
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cypress/integration/2-perusta-projekti/1-velhohaku.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe("Hae projekti Velhosta", () => {
cy.abortEarly();
cy.login("A1");

cy.visit(Cypress.env("host") + "/yllapito/projekti/" + oid + "/arkistoi");
cy.archiveProjekti(oid);
});

it("Hae projekti Velhosta", () => {
Expand Down
4 changes: 3 additions & 1 deletion cypress/integration/2-perusta-projekti/2-perusta.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ describe("Perusta projekti", () => {
cy.abortEarly();
Cypress.config("scrollBehavior", "nearest");
cy.login("A1");
cy.visit(Cypress.env("host") + "/yllapito/projekti/" + oid + "/arkistoi");

cy.archiveProjekti(oid);
});

it("Perusta projekti", () => {
cy.visit(Cypress.env("host") + "/yllapito/perusta/" + oid).get("main");
cy.get('input[name="kayttoOikeudet.0.puhelinnumero"').should("be.enabled").type("0291111111");
cy.get("#save_and_open_projekti").click();
cy.url().should("contain", "/yllapito/projekti/");
});
});
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
/// <reference types="cypress" />

import { abortEarly } from "../../support/commands";

const projektiNimi = Cypress.env("projektiNimi");
const oid = Cypress.env("oid");

describe("Projektin suunnitteluvaihe (perustiedot)", () => {
before(() => {
cy.abortEarly();
});

beforeEach(() => {
cy.login("A1");
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ const oid = Cypress.env("oid");
describe("Projektin suunnitteluvaihe (vuorovaikutukset)", () => {
before(() => {
cy.abortEarly();
});

beforeEach(() => {
cy.login("A1");
});

Expand Down
5 changes: 5 additions & 0 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,8 @@ Cypress.Commands.add("login", (testuser) => {
}
});
});

Cypress.Commands.add("archiveProjekti", (oid) => {
cy.visit(Cypress.env("host") + "/yllapito/projekti/" + oid + "/arkistoi");
cy.get("#result").should("contain", "Arkistoinnin tulos");
});
8 changes: 6 additions & 2 deletions deployment/lib/hassu-pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,17 @@ export class HassuPipelineStack extends Stack {
}

private async createE2eTestPipeline(env: string, config: Config) {
let webhookFilters = undefined;
if (env == "dev") {
webhookFilters = [codebuild.FilterGroup.inEventOf(codebuild.EventAction.PUSH).andBranchIs("robottest/*")];
}
const sourceProps: GitHubSourceProps = {
owner: "finnishtransportagency",
repo: "hassu",
webhook: true,
webhookTriggersBatchBuild: false,
reportBuildStatus: true,
webhookFilters: [codebuild.FilterGroup.inEventOf(codebuild.EventAction.PUSH).andBranchIs("robottest/*")],
webhookFilters,
};
const gitHubSource = codebuild.Source.gitHub(sourceProps);
new codebuild.Project(this, "HassuE2eTest", {
Expand All @@ -191,7 +195,7 @@ export class HassuPipelineStack extends Stack {
environment: {
buildImage: LinuxBuildImage.fromEcrRepository(
Repository.fromRepositoryName(this, "RobotBuildImage", "hassu-buildimage"),
"1.0.4"
"1.0.3"
),
privileged: true,
computeType: ComputeType.MEDIUM,
Expand Down

0 comments on commit 39164ea

Please sign in to comment.