a> 30f7226d9a first commit 2 年之前 tailwind-color-palette 30f7226d9a first commit 2 年之前 tailwindcss 30f7226d9a first commit 2 年之前 thenify 30f7226d9a first commit 2 年之前 thenify-all 30f7226d9a first commit 2 年之前 to-regex-range 30f7226d9a first commit 2 年之前 tr46 30f7226d9a first commit 2 年之前 ts-interface-checker 30f7226d9a first commit 2 年之前 uglify-js 30f7226d9a first commit 2 年之前 underscore 30f7226d9a first commit 2 年之前 upper-case 30f7226d9a first commit 2 年之前 util-deprecate 30f7226d9a first commit 2 年之前 valid-data-url 30f7226d9a first commit 2 年之前 web-resource-inliner 30f7226d9a first commit 2 年之前 webidl-conversions 30f7226d9a first commit 2 年之前 whatwg-url 30f7226d9a first commit 2 年之前 wrap-ansi 30f7226d9a first commit 2 年之前 wrappy 30f7226d9a first commit 2 年之前 y18n 30f7226d9a first commit 2 年之前 yallist 30f7226d9a first commit 2 年之前 yaml 30f7226d9a first commit 2 年之前 yargs 30f7226d9a first commit 2 年之前 yargs-parser 30f7226d9a first commit 2 年之前 .yarn-integrity 30f7226d9a first commit 2 年之前 tum/soc - Gogs: Simplico Git Service

Sin descripción

restFixture.js 724B

12345678910111213141516171819202122232425262728
  1. import { test as base } from '@playwright/test';
  2. import fs from 'node:fs';
  3. import dotenv from 'dotenv';
  4. const _API_URL = 'http://127.0.0.1:8000';
  5. export const test = base.extend({
  6. rest: async ({ playwright }, use) => {
  7. // Set up the fixture.
  8. const envFile = fs.readFileSync('../.env');
  9. const env = dotenv.parse(envFile);
  10. const apiContext = await playwright.request.newContext({
  11. baseURL: _API_URL,
  12. extraHTTPHeaders: {
  13. 'Authorization': `Bearer ${env.IRIS_ADM_API_KEY}`,
  14. 'Content-Type': 'application/json'
  15. },
  16. });
  17. // Use the fixture value in the test.
  18. await use(apiContext);
  19. // Clean up the fixture.
  20. await apiContext.dispose();
  21. },
  22. });