/ tests / claim-orcid.spec.ts
claim-orcid.spec.ts
 1  import { test as base } from '@playwright/test';
 2  import { ConnectedSession, TEST_ADDRESSES } from './fixtures/ConnectedSession';
 3  import { Orcid } from './fixtures/Orcid';
 4  import { orcidClaimManager } from './fixtures/OrcidClaimManager';
 5  
 6  const test = base.extend<{ connectedSession: ConnectedSession; orcid: Orcid }>({
 7    connectedSession: async ({ page }, use) => {
 8      const connectedSession = new ConnectedSession(page, TEST_ADDRESSES[0]);
 9      await connectedSession.goto();
10      await connectedSession.connect();
11  
12      await use(connectedSession);
13    },
14    orcid: async ({ connectedSession }, use) => {
15      await use(new Orcid(connectedSession, orcidClaimManager));
16    },
17  });
18  
19  /**
20   * This test relies on the profile at https://sandbox.orcid.org/0009-0003-3033-0123
21   * having its DRIPS_OWNERSHIP_CLAIM set to
22   * http://0.0.0.0/DRIPS_OWNERSHIP_CLAIM?localtestnet=0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266
23   * (i.e. pointing to the local dev wallet address).
24   */
25  test('claim ORCID flow', async ({ orcid }) => {
26    test.setTimeout(120_000);
27  
28    await orcid.claim();
29  });