Skip to content

Commit d20a08c

Browse files
committed
feat: [AB#16661] Automated Test for License Status Check
1 parent 64555d9 commit d20a08c

File tree

2 files changed

+71
-1
lines changed

2 files changed

+71
-1
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import {
2+
completeBusinessStructureTask,
3+
fillOutLicenseStatusCheckForm,
4+
} from "@businessnjgovnavigator/cypress/support/helpers/helpers";
5+
import { onOnboardingPageStartingBusiness } from "../../support/page_objects/onboardingPageNew";
6+
describe("License Status Check [feature] [all] [group5]", () => {
7+
let checkStatusFormData: {
8+
businessName: string;
9+
addressLine1: string;
10+
addressZipCode: string;
11+
};
12+
beforeEach(() => {
13+
cy.loginByCognitoApi();
14+
checkStatusFormData = {
15+
businessName: "Pending Business Name",
16+
addressLine1: "111 Business St",
17+
addressZipCode: "12345",
18+
};
19+
});
20+
it("shows the Permit Status screen after submitting form for Cosmetology Shop License", () => {
21+
cy.url().should("include", "onboarding?page=1");
22+
onOnboardingPageStartingBusiness.selectBusinessPersonaRadio("STARTING");
23+
onOnboardingPageStartingBusiness.getBusinessPersonaRadio("STARTING").should("be.checked");
24+
onOnboardingPageStartingBusiness.clickNext();
25+
26+
cy.url().should("include", "onboarding?page=2");
27+
onOnboardingPageStartingBusiness.selectIndustryDropdown("cosmetology");
28+
onOnboardingPageStartingBusiness.clickNext();
29+
30+
cy.url().should("include", "dashboard");
31+
32+
completeBusinessStructureTask({ legalStructureId: "limited-liability-company" });
33+
34+
cy.get('[data-testid="apply-for-shop-license"]').click();
35+
cy.contains("Check Status").click();
36+
37+
fillOutLicenseStatusCheckForm(checkStatusFormData);
38+
39+
cy.get('[data-testid="check-status-submit"]').click();
40+
cy.contains("Permit Status:");
41+
});
42+
});

web/cypress/support/helpers/helpers.ts

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import {
44
allFormationLegalTypes,
55
EmploymentPlacementType,
66
FormationLegalType,
7+
getMergedConfig,
78
Industry,
89
LegalStructures,
910
randomInt,
1011
} from "@businessnjgovnavigator/shared";
11-
import { getMergedConfig } from "@businessnjgovnavigator/shared";
1212
import { LighthouseConfig, Pa11yThresholds } from "../types";
1313

1414
const Config = getMergedConfig();
@@ -200,3 +200,31 @@ export const completeTaxClearanceFlow = (): void => {
200200
.should("be.visible")
201201
.and("contain.text", "Your Certificate is Ready!");
202202
};
203+
204+
export const fillOutLicenseStatusCheckForm = ({
205+
businessName,
206+
addressLine1,
207+
addressLine2,
208+
addressZipCode,
209+
}: Partial<{
210+
businessName: string;
211+
addressLine1: string;
212+
addressLine2: string;
213+
addressZipCode: string;
214+
}>): void => {
215+
if (businessName) {
216+
cy.get('[data-testid="business-name"]').type(businessName);
217+
}
218+
219+
if (addressLine1) {
220+
cy.get('[data-testid="address-1"]').type(addressLine1);
221+
}
222+
223+
if (addressLine2) {
224+
cy.get('[data-testid="address-2"]').type(addressLine2);
225+
}
226+
227+
if (addressZipCode) {
228+
cy.get('[data-testid="zipcode"]').type(addressZipCode);
229+
}
230+
};

0 commit comments

Comments
 (0)