QA Interview Hub · Knowledge base · Quizzes · Українська
32 questions on Patterns, from the basics to the hard ones. Answers and explanations are in the quiz and the knowledge base.
By level: Junior QA interview questions · Middle QA interview questions · Senior QA interview questions
async isErrorShown() {
return this.error.isVisible();
}
// test
await loginPage.login('a@b.com', 'bad');
expect(await loginPage.isErrorShown()).toBe(true);Take the quiz for this chapter · Read the explanation in the knowledge base
BasePage has a header and a menu, and all pages inherit it. A login page without a header was added. What is the problem? Middlerows() return? Middleclass DataTable {
constructor(private root: Locator, private page: Page) {}
rows() {
return this.page.getByRole('row');
}
}Take the quiz for this chapter · Read the explanation in the knowledge base
export const test = base.extend<{}, { account: Account }>({
account: [async ({ page }, use) => {
const acc = await createViaUi(page);
await use(acc);
}, { scope: 'worker' }],
});{ auto: true } appropriate for? SeniorTake the quiz for this chapter · Read the explanation in the knowledge base
p1.amount be? Middleclass PaymentBuilder {
private data = { amount: 100, currency: 'EUR' };
withAmount(a: number) { this.data.amount = a; return this; }
build() { return this.data; }
}
const b = new PaymentBuilder();
const p1 = b.build();
const p2 = b.withAmount(0).build();workers: 4, and faker.seed() is never called. What happens to the users' emails? Seniorclass UserBuilder {
static readonly DEFAULTS = { email: faker.internet.email() };
private overrides: Partial<NewUser> = {};
build() {
return { ...UserBuilder.DEFAULTS, ...this.overrides };
}
}Take the quiz for this chapter · Read the explanation in the knowledge base
Partial used in the factory createCard(overrides: Partial<Card> = {})? Juniorcard.holder have? Middlefunction createCard(o: Partial<Card> = {}): Card {
return { holder: 'TEST USER', expiry: '12/30', ...o };
}
const card = createCard({ holder: undefined });DEFAULT_USER without copying it. One test does user.email = 'x@test.com'. What happens? SeniorTake the quiz for this chapter · Read the explanation in the knowledge base
{ box: true } option change in this step? Seniorasync sendMoney(to: string, amount: number) {
return test.step(`send ${amount} to ${to}`, async () => {
await this.transfer.fill(to, amount);
await this.transfer.confirm();
}, { box: true });
}Take the quiz for this chapter · Read the explanation in the knowledge base
BrowserStrategy with classes for Chromium, Firefox and WebKit. Your reaction? SeniorTake the quiz for this chapter · Read the explanation in the knowledge base
let cache = {}. Tests run in 4 workers. How many copies of cache exist? Middleundefined instead of the token? Middle// global-setup.ts
export default async function globalSetup() {
(globalThis as any).token = await fetchToken();
}
// payments.spec.ts
test('list', async ({ request }) => {
const token = (globalThis as any).token; // undefined
});test.info().parallelIndex is chosen rather than workerIndex. Why? SeniorTake the quiz for this chapter · Read the explanation in the knowledge base
if (await page.getByRole('dialog', { name: 'Promo' }).isVisible()) {
await page.getByRole('button', { name: 'Close' }).click();
}
await checkout.pay();locator.click(). What is wrong with it? Seniorasync click(locator: Locator) {
await locator.click();
}Take the quiz for this chapter · Read the explanation in the knowledge base