move two simple API routines from core/helpers.js to api/api.js

This commit is contained in:
Brent Baccala 2022-10-09 15:35:07 -04:00
parent 6f7c82641f
commit f2b53df4fc
2 changed files with 9 additions and 11 deletions

View File

@ -4,9 +4,17 @@ const { expect } = require("@playwright/test");
const Page = require('../core/page'); const Page = require('../core/page');
const parameters = require('../core/parameters'); const parameters = require('../core/parameters');
const { createMeeting, getMeetings, getMeetingInfo } = require('../core/helpers'); const { apiCall, createMeeting } = require('../core/helpers');
const e = require('../core/elements'); const e = require('../core/elements');
function getMeetings() {
return apiCall('getMeetings', {});
}
function getMeetingInfo(meetingID) {
return apiCall('getMeetingInfo', {meetingID: meetingID});
}
class API { class API {
constructor(browser, context, page) { constructor(browser, context, page) {

View File

@ -28,14 +28,6 @@ function apiCall(name, callParams) {
return axios.get(url, { adapter: http }).then(response => xml2js.parseStringPromise(response.data)); return axios.get(url, { adapter: http }).then(response => xml2js.parseStringPromise(response.data));
} }
function getMeetings() {
return apiCall('getMeetings', {});
}
function getMeetingInfo(meetingID) {
return apiCall('getMeetingInfo', {meetingID: meetingID});
}
function createMeetingUrl(params, customParameter) { function createMeetingUrl(params, customParameter) {
const meetingID = `random-${getRandomInt(1000000, 10000000).toString()}`; const meetingID = `random-${getRandomInt(1000000, 10000000).toString()}`;
const mp = params.moderatorPW; const mp = params.moderatorPW;
@ -79,8 +71,6 @@ function sleep(time) {
exports.getRandomInt = getRandomInt; exports.getRandomInt = getRandomInt;
exports.apiCallUrl = apiCallUrl; exports.apiCallUrl = apiCallUrl;
exports.apiCall = apiCall; exports.apiCall = apiCall;
exports.getMeetings = getMeetings;
exports.getMeetingInfo = getMeetingInfo;
exports.createMeetingUrl = createMeetingUrl; exports.createMeetingUrl = createMeetingUrl;
exports.createMeetingPromise = createMeetingPromise; exports.createMeetingPromise = createMeetingPromise;
exports.createMeeting = createMeeting; exports.createMeeting = createMeeting;