Skip to content

Commit 7526968

Browse files
committed
URLChanger 의 URL 들이 쉽게 변경 될 수 있도록 변경
1 parent e5c9aec commit 7526968

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

src/app/naver/urlChanger.test.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ describe("Login", () => {
1010
await urlChanger.moveToLoginURL();
1111

1212
// then
13-
expect(pageSpy).toHaveBeenCalledWith(
14-
"https://nid.naver.com/nidlogin.login"
15-
);
13+
expect(pageSpy).toHaveBeenCalledWith(urlChanger.loginURL);
1614
});
1715
});
1816

@@ -28,8 +26,6 @@ describe("PaymentHistory", () => {
2826
await urlChanger.moveToPaymentHistoryURL();
2927

3028
// then
31-
expect(pageSpy).toHaveBeenCalledWith(
32-
"https://new-m.pay.naver.com/historybenefit/paymenthistory"
33-
);
29+
expect(pageSpy).toHaveBeenCalledWith(urlChanger.paymentHistoryURL);
3430
});
3531
});

src/app/naver/urlChanger.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,20 @@ import puppeteer from "puppeteer";
22

33
export default class URLChanger {
44
private readonly page: puppeteer.Page;
5+
loginURL = "https://nid.naver.com/nidlogin.login";
6+
paymentHistoryURL =
7+
"https://new-m.pay.naver.com/historybenefit/paymenthistory";
58

69
constructor(page: puppeteer.Page) {
710
this.page = page;
811
}
912

1013
async moveToLoginURL() {
11-
await this.page.goto("https://nid.naver.com/nidlogin.login");
14+
await this.page.goto(this.loginURL);
1215
}
1316

1417
async moveToPaymentHistoryURL() {
15-
await this.page.goto(
16-
"https://new-m.pay.naver.com/historybenefit/paymenthistory"
17-
);
18+
await this.page.goto(this.paymentHistoryURL);
1819
await this.page.waitForSelector("div[class^='paymentHistory_section__']");
1920
}
2021
}

0 commit comments

Comments
 (0)