This repository was archived by the owner on Nov 24, 2025. It is now read-only.
Migrate Tenant test from TP E2E to TP integration test#6244
Merged
ocket8888 merged 9 commits intoapache:masterfrom Oct 8, 2021
Merged
Migrate Tenant test from TP E2E to TP integration test#6244ocket8888 merged 9 commits intoapache:masterfrom
ocket8888 merged 9 commits intoapache:masterfrom
Conversation
added 8 commits
September 30, 2021 15:54
ocket8888
reviewed
Oct 7, 2021
|
|
||
| private btnCreateNewTenant = element(by.xpath("//button[@title='Create New Tenant']")); | ||
| private txtName = element(by.name('name')); | ||
| private txtActive = element(by.name('active')); |
Contributor
There was a problem hiding this comment.
indentation should be consistent within a file; there are still places using 4-space indentation. If you're gonna change the indentation in so many places, you should change it everywhere in the file consistently (and you should use tabs because tabs >>>>> spaces)
| await this.txtParentTenant.sendKeys(tenant.ParentTenant + this.randomize); | ||
| } | ||
| await basePage.ClickCreate(); | ||
| return await basePage.GetOutputMessage().then(value => tenant.validationMessage === value); |
Contributor
There was a problem hiding this comment.
await is unnecessary in a return statement; a Promise that resolves to a Promise is not resolved until that nested Promise is resolved:
/** @param p {Promise<unknown>} */
async function printAwait(p) {
console.log(await p);
}
/**
* @template T
* @param p {Promise<T>}
* @returns {Promise<Promise<T>>}
*/
async function nestPromise(p) {
return p;
}
/**
* @template T
* @param p {Promise<T>}
* @returns {Promise<T>}
*/
async function awaitPromise(p) {
return await p;
}
const p1 = new Promise(r=>r(5));
const p2 = new Promise(r=>r(p1));
// These are all equivalent
printAwait(p1); // outputs: 5
printAwait(p2); // outputs: 5
printAwait(nestPromise(p1)); // outputs: 5
printAwait(awaitPromise(p1)); // outputs: 5
printAwait(nestPromise(p2)); // outputs: 5
printAwait(awaitPromise(p2)); // outputs: 5const p1 = new Promise(r=>r(5));
Contributor
Author
|
@ocket8888 Fixed. await. and identation. |
ocket8888
approved these changes
Oct 8, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which Traffic Control components are affected by this PR?
What is the best way to verify this PR?
Make sure all tests are migrate in integration/Data/tenant.ts directory.
https://github.com/apache/trafficcontrol/blob/master/traffic_portal/test/e2e_deprecated/tenants/tenants-spec.js
Go to traffic_portal/test/integration and run
npm test -- --params.baseUrl https://localhost --capabilities.shardTestFiles trueand make sure test all pass.Make sure CI tests pass also.
If this is a bugfix, which Traffic Control versions contained the bug?
PR submission checklist