-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update E2E basicMap test - #61
- Loading branch information
Showing
18 changed files
with
93 additions
and
27 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { Map } from "react-kakao-maps-sdk" | ||
import useKakaoLoader from "./useKakaoLoader" | ||
import { useState } from "react" | ||
|
||
export default function DisableMapDragMove() { | ||
useKakaoLoader() | ||
const [draggable, setDraggable] = useState<boolean>(true) | ||
|
||
return ( | ||
<Map // 지도를 표시할 Container | ||
id="map" | ||
center={{ | ||
// 지도의 중심좌표 | ||
lat: 33.450701, | ||
lng: 126.570667, | ||
}} | ||
style={{ | ||
// 지도의 크기 | ||
width: "100%", | ||
height: "350px", | ||
}} | ||
level={3} // 지도의 확대 레벨 | ||
draggable={draggable} | ||
> | ||
<p> | ||
<button onClick={() => setDraggable(false)}> | ||
지도 드래그 이동 끄기 | ||
</button>{" "} | ||
<button onClick={() => setDraggable(true)}> | ||
지도 드래그 이동 켜기 | ||
</button> | ||
</p> | ||
</Map> | ||
) | ||
} |
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
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
Binary file added
BIN
+174 KB
...k/__test__/basicMap.spec.ts-snapshots/ScreenShot-렌더링-결과-비교-2-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+209 KB
...dk/__test__/basicMap.spec.ts-snapshots/ScreenShot-렌더링-결과-비교-2-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+164 KB
...sdk/__test__/basicMap.spec.ts-snapshots/ScreenShot-렌더링-결과-비교-2-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions
38
packages/react-kakao-maps-sdk/__test__/disableMapDragMove.spec.ts
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { test, expect } from "@playwright/test" | ||
|
||
const getUrl = (id: string, isUpdateSanpShots: boolean = false) => | ||
isUpdateSanpShots | ||
? `http://127.0.0.1:5252/samples/${id}.html` | ||
: `/samples/${id}` | ||
|
||
test("ScreenShot 렌더링 결과 비교", async ({ page }, testInfo) => { | ||
const url = getUrl( | ||
"disableMapDragMove", | ||
testInfo.config.updateSnapshots === "all", | ||
) | ||
await page.goto(url, { waitUntil: "networkidle" }) | ||
await expect(page).toHaveScreenshot() | ||
const firstRenderScreenshot = await page.screenshot() | ||
|
||
const drag = async () => { | ||
const mapBoundingBox = await page.locator("#map").boundingBox() | ||
await page.mouse.move(mapBoundingBox!.x, mapBoundingBox!.y) | ||
await page.mouse.down() | ||
await page.mouse.move( | ||
mapBoundingBox!.x + mapBoundingBox!.width / 2, | ||
mapBoundingBox!.y + mapBoundingBox!.height / 2, | ||
) | ||
await page.mouse.up() | ||
await page.waitForLoadState("networkidle") | ||
} | ||
|
||
await page.getByText("지도 드래그 이동 끄기").click() | ||
await drag() | ||
expect(await page.screenshot()).toStrictEqual(firstRenderScreenshot) | ||
await expect(page).toHaveScreenshot() | ||
|
||
await page.getByText("지도 드래그 이동 켜기").click() | ||
await drag() | ||
expect(await page.screenshot()).not.toStrictEqual(firstRenderScreenshot) | ||
await expect(page).toHaveScreenshot() | ||
}) |
Binary file added
BIN
+191 KB
.../disableMapDragMove.spec.ts-snapshots/ScreenShot-렌더링-결과-비교-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+219 KB
..._/disableMapDragMove.spec.ts-snapshots/ScreenShot-렌더링-결과-비교-1-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+183 KB
...__/disableMapDragMove.spec.ts-snapshots/ScreenShot-렌더링-결과-비교-1-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+191 KB
.../disableMapDragMove.spec.ts-snapshots/ScreenShot-렌더링-결과-비교-2-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+219 KB
..._/disableMapDragMove.spec.ts-snapshots/ScreenShot-렌더링-결과-비교-2-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+183 KB
...__/disableMapDragMove.spec.ts-snapshots/ScreenShot-렌더링-결과-비교-2-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+175 KB
.../disableMapDragMove.spec.ts-snapshots/ScreenShot-렌더링-결과-비교-3-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+213 KB
..._/disableMapDragMove.spec.ts-snapshots/ScreenShot-렌더링-결과-비교-3-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+167 KB
...__/disableMapDragMove.spec.ts-snapshots/ScreenShot-렌더링-결과-비교-3-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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