Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update testRunner and LabClient
  • Loading branch information
tnorling committed Jun 17, 2020
commit afd59f084f24d18b0bdbb1b265ccd294593ae0ca
20 changes: 18 additions & 2 deletions samples/VanillaJSTestApp/e2eTests/LabClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,26 @@ export class LabClient {
return null;
}

async getUserVarsByCloudEnvironment(envName: string): Promise<any> {
async getUserVarsByCloudEnvironment(envName: string, usertype?: string, federationprovider?:string): Promise<any> {
const accessToken = await this.getCurrentToken();
let apiParams: Array<string> = [];

return await this.requestLabApi(`/user?azureenvironment=${envName}`, accessToken);
if (envName) {
apiParams.push(`azureenvironment=${envName}`);
}
if (usertype) {
apiParams.push(`usertype=${usertype}`);
}
if (federationprovider) {
apiParams.push(`federationprovider=${federationprovider}`);
}

if (apiParams.length <= 0) {
throw "Must provide at least one param to getUserVarsByCloudEnvironment";
}
const apiUrl = '/user?' + apiParams.join("&");

return await this.requestLabApi(apiUrl, accessToken);
}

async getSecret(secretName: string): Promise<any> {
Expand Down
4 changes: 4 additions & 0 deletions samples/VanillaJSTestApp/e2eTests/testRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ function runMochaTests(sampleIndex: number) {
res.sendFile(path.join(`${APP_DIR}/${sampleName}/index.html`));
});

if (sampleName === "adfs") {
port = 8080; // Temporary workaround until lab team adds redirectUri
}

let server = app.listen(port);
console.log(`Listening on port ${port}...`);

Expand Down