1
0
cucumber-js-demo/async/features/steps/async.js
2024-12-20 15:03:16 +01:00

13 lines
344 B
JavaScript

import { When } from '@cucumber/cucumber'
import axios from 'axios'
When('I request the same resource twice', async function () {
const url = 'http://localhost:8080/'
const firstResponse = await axios.request(url)
this.first = firstResponse.data
const secondResponse = await axios.request(url)
this.second = secondResponse.data
})