-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from code-yeongyu/remove-legacy
사용하지 않는 메소드들을 삭제합니다.
- Loading branch information
Showing
9 changed files
with
18 additions
and
880 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,16 +1,8 @@ | ||
import { | ||
URLChanger, | ||
PageInteractor, | ||
ElementParser, | ||
NaverScraper, | ||
NaverParser, | ||
} from "."; | ||
import { Module as BaseModule } from "../common"; | ||
import { URLChanger, PageInteractor, NaverScraper, NaverParser } from "."; | ||
|
||
export default interface Module extends BaseModule { | ||
export default interface Module { | ||
readonly urlChanger: URLChanger; | ||
readonly pageInteractor: PageInteractor; | ||
readonly elementParser: ElementParser; | ||
readonly scraper: NaverScraper; | ||
readonly parser: NaverParser; | ||
} |
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
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,31 +1,17 @@ | ||
import URLChanger from "./urlChanger"; | ||
|
||
describe("Login", () => { | ||
it("Should move page to login", async () => { | ||
// given | ||
const urlChanger = new URLChanger(page); | ||
const pageSpy = jest.spyOn(page, "goto"); | ||
describe("URLChanger", () => { | ||
describe("moveToLoginURL", () => { | ||
it("Should move page to login", async () => { | ||
// given | ||
const urlChanger = new URLChanger(page); | ||
const pageSpy = jest.spyOn(page, "goto"); | ||
|
||
// when | ||
await urlChanger.moveToLoginURL(); | ||
// when | ||
await urlChanger.moveToLoginURL(); | ||
|
||
// then | ||
expect(pageSpy).toHaveBeenCalledWith(urlChanger.loginURL); | ||
}); | ||
}); | ||
|
||
describe("PaymentHistory", () => { | ||
it("Should move page to payment history", async () => { | ||
// given | ||
const urlChanger = new URLChanger(page); | ||
const pageSpy = jest.spyOn(page, "goto"); | ||
const waitForSelectorSpy = jest.spyOn(page, "waitForSelector"); | ||
waitForSelectorSpy.mockImplementation(() => Promise.resolve(null)); | ||
|
||
// when | ||
await urlChanger.moveToPaymentHistoryURL(); | ||
|
||
// then | ||
expect(pageSpy).toHaveBeenCalledWith(urlChanger.paymentHistoryURL); | ||
// then | ||
expect(pageSpy).toHaveBeenCalledWith(urlChanger.loginURL); | ||
}); | ||
}); | ||
}); |
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 |
---|---|---|
@@ -1,20 +1,12 @@ | ||
import puppeteer from "puppeteer"; | ||
|
||
export default class URLChanger { | ||
loginURL = "https://nid.naver.com/nidlogin.login"; | ||
paymentHistoryURL = | ||
"https://new-m.pay.naver.com/historybenefit/paymenthistory"; | ||
|
||
constructor(private readonly page: puppeteer.Page) { | ||
this.page = page; | ||
} | ||
|
||
loginURL = "https://nid.naver.com/nidlogin.login"; | ||
async moveToLoginURL() { | ||
await this.page.goto(this.loginURL); | ||
} | ||
|
||
async moveToPaymentHistoryURL() { | ||
await this.page.goto(this.paymentHistoryURL); | ||
await this.page.waitForSelector("div[class^='paymentHistory_section__']"); | ||
} | ||
} |