Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests for FAQ #2913

Merged
merged 4 commits into from
Jul 12, 2022
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
15 changes: 15 additions & 0 deletions packages/yoroi-extension/features/faq.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Feature: Wallet UI FAQ

Background:
Given I have opened the extension
And I have completed the basic setup
Then I should see the Create wallet screen
Given There is a Shelley wallet stored named shelley-simple-15
Then Revamp. I switch to revamp version
And I should see the FAQ button

@faq-1
Scenario: Press FAQ button
When I click on FAQ button
Then I should see a new tab opened with address https://emurgohelpdesk.zendesk.com/hc/en-us/categories/4412619927695-Yoroi

2 changes: 1 addition & 1 deletion packages/yoroi-extension/features/pages/sidebarPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ export const stakingButton = { locator: 'sidebar.staking', method: 'id' };
export const assetsButton = { locator: 'sidebar.assets', method: 'id' };
export const votingButton = { locator: 'sidebar.voting', method: 'id' };
export const settingsButton = { locator: 'sidebar.settings', method: 'id' };
export const faqButton = { locator: 'sidebar.faq', method: 'id' };
export const faqButton = { locator: '.SidebarRevamp_faq', method: 'css' };
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// @flow

import { When, Given, Then } from 'cucumber';
import { expect } from 'chai';
import { faqButton } from '../pages/sidebarPage';
import { faqTabName } from '../support/windowManager';

When(/^I click on FAQ button$/, async function () {
this.webDriverLogger.info(`Step: I click on FAQ button`);
await this.click(faqButton);
});

Then(/^I should see the FAQ button$/, async function () {
this.webDriverLogger.info(`Step: I should see FAQ button`);
await this.waitForElement(faqButton);
});

Then(/^I should see a new tab opened with address (.+)$/, async function (address) {
this.webDriverLogger.info(`Step: I should see a new tab opened with address ${address}`);
await this.windowManager.findNewWindowAndSwitchTo(faqTabName);
const actualAddresses = await this.driver.getCurrentUrl();
expect(actualAddresses).to.equal(address);
});
1 change: 1 addition & 0 deletions packages/yoroi-extension/features/support/windowManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class WindowManagerError extends Error {}
export const mockDAppName = 'MockDApp';
export const popupConnectorName = 'popupConnectorWindow';
export const extensionTabName = 'Yoroi';
export const faqTabName = "Yoroi - EMURGO";

export class WindowManager {
windowHandles: Array<CustomWindowHandle>;
Expand Down