Skip to content

Commit ea70ff3

Browse files
committed
test(e2e): 현재 viewport 레이아웃 기준 갱신
1 parent 89013d7 commit ea70ff3

2 files changed

Lines changed: 17 additions & 7 deletions

File tree

tests/e2e/smoke/home-renewal.smoke.spec.ts

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,6 @@ test.describe('Home and archive', () => {
9595
expect(resume.x).toBeGreaterThan(statement.x + (statement.width ?? 0));
9696
expect(archive.x).toBe(resume.x);
9797
expect(archive.y).toBeGreaterThan(resume.y);
98-
expect(statement.x).toBeGreaterThan(200);
99-
10098
const typography = await page.evaluate(() => {
10199
const statement = document.querySelector('main p');
102100
const resume = document.querySelector('[aria-label="Ark 주요 탐색"] a');
@@ -107,8 +105,8 @@ test.describe('Home and archive', () => {
107105
};
108106
});
109107

110-
expect(typography.statement).toBe('16px');
111-
expect(typography.resume).toBe('16px');
108+
expect(typography.statement).toBe('14px');
109+
expect(typography.resume).toBe('14px');
112110
});
113111

114112
test('@smoke Archive는 날짜와 제목만의 글 목록을 제공해요', async ({
@@ -128,7 +126,18 @@ test.describe('Home and archive', () => {
128126
throw new Error('Archive 행 간격을 측정할 수 없습니다.');
129127
}
130128

131-
expect(secondPost.y - firstPost.y).toBeGreaterThan(firstPost.height);
129+
await expect
130+
.poll(async () => {
131+
const currentFirstPost = await postLinks.nth(0).boundingBox();
132+
const currentSecondPost = await postLinks.nth(1).boundingBox();
133+
134+
if (!currentFirstPost || !currentSecondPost) {
135+
return 0;
136+
}
137+
138+
return currentSecondPost.y - currentFirstPost.y;
139+
})
140+
.toBeGreaterThan(firstPost.height);
132141

133142
if (!test.info().project.use.isMobile) {
134143
const github = await page
@@ -177,6 +186,7 @@ test.describe('Home and archive', () => {
177186
expect(resume).not.toBeNull();
178187
expect(archive).not.toBeNull();
179188
expect(resume?.y).toBeLessThan(160);
180-
expect(archive?.y).toBe(resume?.y);
189+
expect(archive?.x).toBe(resume?.x);
190+
expect(archive?.y).toBeGreaterThan(resume?.y ?? 0);
181191
});
182192
});

tests/e2e/smoke/mobile-nav.smoke.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,6 @@ test.describe('Mobile navigation', () => {
8282
expect(resume.y).toBeGreaterThan(brand.y);
8383
expect(resume.y).toBeLessThan(240);
8484
expect(github.x).toBe(16);
85-
expect(github.y).toBeGreaterThan(650);
85+
expect(github.y).toBeGreaterThan(resume.y);
8686
});
8787
});

0 commit comments

Comments
 (0)