social-agent-cli 5.0.6 → 5.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/upload-helper.ts +36 -5
- package/package.json +1 -1
package/core/upload-helper.ts
CHANGED
|
@@ -18,19 +18,50 @@ async function upload() {
|
|
|
18
18
|
const fc = await fcPromise;
|
|
19
19
|
await fc.setFiles(filePath);
|
|
20
20
|
|
|
21
|
-
// 2. Editör modal'ı çıkarsa
|
|
21
|
+
// 2. Editör/düzenleme modal'ı çıkarsa kapat
|
|
22
22
|
await page.waitForTimeout(3000);
|
|
23
|
-
|
|
23
|
+
|
|
24
|
+
// X: "Düzenle" overlay'ındaki X (kapat) butonunu veya overlay'ı kapat
|
|
25
|
+
// LinkedIn: "İleri/Bitti/Done" butonuna tıkla
|
|
26
|
+
const closeButtons = [
|
|
27
|
+
// LinkedIn
|
|
28
|
+
{ role: "button" as const, name: "İleri" },
|
|
29
|
+
{ role: "button" as const, name: "Bitti" },
|
|
30
|
+
{ role: "button" as const, name: "Done" },
|
|
31
|
+
{ role: "button" as const, name: "Next" },
|
|
32
|
+
{ role: "button" as const, name: "Tamam" },
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
for (const btn of closeButtons) {
|
|
24
36
|
try {
|
|
25
|
-
const
|
|
26
|
-
if (await
|
|
27
|
-
await
|
|
37
|
+
const el = page.getByRole(btn.role, { name: btn.name });
|
|
38
|
+
if (await el.isVisible({ timeout: 500 })) {
|
|
39
|
+
await el.click();
|
|
28
40
|
await page.waitForTimeout(1500);
|
|
29
41
|
break;
|
|
30
42
|
}
|
|
31
43
|
} catch {}
|
|
32
44
|
}
|
|
33
45
|
|
|
46
|
+
// X: Düzenle overlay'ı hâlâ açıksa, overlay dışına tıkla veya ESC
|
|
47
|
+
try {
|
|
48
|
+
const overlay = page.locator('[data-testid="editButton"]');
|
|
49
|
+
if (await overlay.isVisible({ timeout: 500 })) {
|
|
50
|
+
// Overlay'ın dışına tıkla veya ESC bas
|
|
51
|
+
await page.keyboard.press("Escape");
|
|
52
|
+
await page.waitForTimeout(1000);
|
|
53
|
+
}
|
|
54
|
+
} catch {}
|
|
55
|
+
|
|
56
|
+
// X: "Düzenle" yazısı hâlâ görünüyorsa, overlay'ın X butonuna bas
|
|
57
|
+
try {
|
|
58
|
+
const closeBtn = page.locator('[aria-label="Close"], [aria-label="Kapat"], [data-testid="app-bar-close"]');
|
|
59
|
+
if (await closeBtn.first().isVisible({ timeout: 500 })) {
|
|
60
|
+
await closeBtn.first().click();
|
|
61
|
+
await page.waitForTimeout(1000);
|
|
62
|
+
}
|
|
63
|
+
} catch {}
|
|
64
|
+
|
|
34
65
|
console.log("OK");
|
|
35
66
|
process.exit(0);
|
|
36
67
|
}
|