NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

// ── 우편번호 자동 입력 + 제출 (+ 상태 메시지 대기) ──────────────────────────
const pinInput = page.locator('#product-pincode-01');

if ((await pinInput.count()) > 0 && (await pinInput.isVisible())) {
// 현재 URL에서 .com/ 다음 첫 세그먼트 → 국가코드(앞 2글자)
const href = await page.url();
const pathOnly = href.replace(/^https?://[^/]+/i, '').replace(/[?#].*$/, '');
const firstSeg = (pathOnly.split('/').filter(Boolean)[0] ?? '').toLowerCase();
const country = (firstSeg.match(/^[a-z]{2}/)?.[0] ?? '').toLowerCase();

// 국가별 우편번호 매핑 (필요 시 추가)
const ZIP_BY_COUNTRY = {
hu: '1011', // 헝가리
br: '1012', // 브라질
// pt: '1012',
// se: '10xx',
};

const zip = ZIP_BY_COUNTRY[country] ?? null;
console.log('[PIN] href:', href);
console.log('[PIN] country:', country, '→ zip:', zip);

if (zip) {
await pinInput.fill(zip);

// 같은 form의 submit → 전역 submit → 클래스 폴백
let submitBtn = pinInput.locator('xpath=ancestor::form[1]//button[@type="submit"]');
if ((await submitBtn.count()) === 0) submitBtn = page.locator('button[type="submit"]');
if ((await submitBtn.count()) === 0) submitBtn = page.locator('.cmp-button.c-button, .c-button');

if ((await submitBtn.count()) > 0 && (await submitBtn.first().isVisible())) {
await submitBtn.first().click();
console.log('[PIN] submitted');

// (추가) pincode 제출 후 상태 메시지(role="status") 대기
const status = page.locator('.cmp-text[role="status"], [role="status"] .cmp-text, [role="status"]');
await status.first().waitFor({ state: 'attached', timeout: 6000 }).catch(() => {});
let _statusSeen = false;
try {
await expect(status).toBeVisible({ timeout: 6000 });
_statusSeen = true;
} catch {
try {
await expect(status).toHaveText(/.+/s, { timeout: 6000 });
_statusSeen = true;
} catch {}
}
const statusText = (await status.first().innerText().catch(() => ''))?.trim?.() ?? '';
console.log('[PIN][STATUS] seen:', _statusSeen, '| text:', statusText || '(no text)');
} else {
console.log('[PIN] submit button not found/visible');
}
} else {
console.log('[PIN] no zipcode mapping for country:', country);
}
} else {
console.log('[PIN] input #product-pincode-01 not present/visible — skipped');
}
     
 
what is notes.io
 

Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 14 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.