Skip to content

Commit

Permalink
PLT-5884 fix configuration to find feature files
Browse files Browse the repository at this point in the history
  • Loading branch information
ladamesny committed May 30, 2023
1 parent 6f02abb commit b357423
Show file tree
Hide file tree
Showing 11 changed files with 343 additions and 110 deletions.
2 changes: 1 addition & 1 deletion e2e/env/common.env
Expand Up @@ -6,7 +6,7 @@ JSON_REPORT_FILE="./reports/reports.json"
HOSTS_URLS_PATH="/config/hosts.json"
PAGE_URLS_PATH="/config/pages.json"
HTML_REPORT_FILE="./reports/cucumber-html-report.html"
PAGE_ELEMENTS_PATH="/config/mappings/page-elements/"
PAGE_ELEMENT_MAPPINGS_PATH="/config/mappings/page-elements/"
FIXTURES_PATH="/config/mappings/fixtures/"
SCRIPT_TIMEOUT=40000
DEVTOOLS=false
183 changes: 175 additions & 8 deletions e2e/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions e2e/src/env/global.ts
Expand Up @@ -11,5 +11,6 @@ export type FixtureMappings = Record<FixtureId, string>;
export type GlobalConfig = {
hostsConfig: HostsConfig;
pagesConfig: PagesConfig;
pageElementMappings: PageElementMappings;
fixtureMappings: FixtureMappings;
}
21 changes: 21 additions & 0 deletions e2e/src/features/home-page.feature
@@ -0,0 +1,21 @@
Feature: As a user I should be able to see the Marlowe Playground home page

As a user I should be able to navigate to the marlowe playground home page and
see all the starting point options available

@dev
@smoke
@regression
Scenario: As a user I expect to be able to see the available languages

Given I am on the "home" page
Then I should see "Start in Javascript" text
And I should see "Start in Haskell" text
And I should see "Start in Marlowe" text
And I should see "Start in Blockly" text
And I should see "Start in Haskell" text
And I should see a button with "Open existing project" text
And I should see a button with "Open an example" text

When I click "Open existing project" button
Then I should see "Login with github" text
7 changes: 4 additions & 3 deletions e2e/src/index.ts
Expand Up @@ -15,12 +15,12 @@ import * as fs from 'fs';
dotenv.config({path: env('COMMON_CONFIG_FILE')})
const hostsConfig: HostsConfig = getJsonFromFile(env('HOSTS_URLS_PATH'))
const pagesConfig: PagesConfig = getJsonFromFile(env('PAGE_URLS_PATH'))
const playgroundPageMappingFiles = fs.readdirSync(`${process.cwd()}${env('PAGE_ELEMENTS_PATH')}`)
const pageMappingFiles = fs.readdirSync(`${process.cwd()}${env('PAGE_ELEMENT_MAPPINGS_PATH')}`)

const playgroundPageElementMappings: PageElementMappings = playgroundPageMappingFiles.reduce(
const pageElementMappings: PageElementMappings = pageMappingFiles.reduce(
(pageElementConfigAcc, file) => {
const key = file.replace('.json', '');
const elementMappings = getJsonFromFile(`${env('PAGE_ELEMENTS_PATH')}${file}`);
const elementMappings = getJsonFromFile(`${env('PAGE_ELEMENT_MAPPINGS_PATH')}${file}`);
return { ...pageElementConfigAcc, [key]: elementMappings}
},
{}
Expand All @@ -39,6 +39,7 @@ const fixtureMappings: FixtureMappings = fixtureMappingFiles.reduce(
const worldParameters: GlobalConfig = {
hostsConfig,
pagesConfig,
pageElementMappings,
fixtureMappings,
};

Expand Down
Expand Up @@ -14,12 +14,19 @@ Then(
globalConfig
} = this;

console.log("ElementKey: ", elementKey)
const elementIdentifier = getElementLocator(page, elementKey, globalConfig);
const { role, name } = elementIdentifier;

console.log("ROLE: ", role)
console.log("NAMEL ", name)

await waitFor(async() => {
console.log("INSIDE WAIT BEGIN")
const locator = await queries.getByRole(document, role, { name })
console.log("LOCATOR: ", locator)
const isElementVisible = await locator.isVisible()
console.log("isVISIBLE: ", isElementVisible)
return isElementVisible;
})
}
Expand Down

0 comments on commit b357423

Please sign in to comment.