Use native Chrome for Reddit login handoff
This commit is contained in:
1 parent
2c533fa52a
commit
dbb1842ef4
13 files changed
+324
-60
No files matched your search
@@ -57,7 +57,7 @@ describe('BrowserClient external Chrome', () => {
|
||||
expect(runtime.launchPersistentContext).toHaveBeenCalledOnce();
|
||||
});
|
||||
|
||||
it('opens the login page for a human without submitting credentials', async () => {
|
||||
it('does not control external Chrome during native human login', async () => {
|
||||
process.env.CHROME_CDP_URL = 'http://127.0.0.1:9222';
|
||||
const page = {
|
||||
goto: vi.fn().mockResolvedValue(undefined),
|
||||
@@ -79,11 +79,8 @@ describe('BrowserClient external Chrome', () => {
|
||||
await client.initialize();
|
||||
|
||||
await expect(client.login()).resolves.toBe(false);
|
||||
expect(page.bringToFront).toHaveBeenCalledOnce();
|
||||
expect(page.goto).toHaveBeenCalledWith(
|
||||
'https://www.reddit.com/login',
|
||||
{ waitUntil: 'domcontentloaded' },
|
||||
);
|
||||
expect(page.bringToFront).not.toHaveBeenCalled();
|
||||
expect(page.goto).not.toHaveBeenCalled();
|
||||
expect(page.fill).not.toHaveBeenCalled();
|
||||
expect(client.getSessionState()).toBe('login-required');
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user