Skip to content

Commit

Permalink
Fix #14 : Change navToSF using SF URL instead of link click
Browse files Browse the repository at this point in the history
  • Loading branch information
AZn5ReD committed Jan 11, 2021
1 parent 5cbfb95 commit 0ed0761
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ dist

# Test files
data/
config_test.json
config*.json
fonts/

# Build
build/
Expand Down
2 changes: 1 addition & 1 deletion src/constants.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"PASSWORD_SELECTOR": "input[id='j_password']",
"SUBMIT_SELECTOR": "button[id='logOnFormSubmit']",
"URL_CONNECTED": "https://learninghub.sap.com/?languagePrompt=true",
"SUCCESS_FACTOR_LINK_SELECTOR": "a[href^='https://performancemanager.successfactors.eu/']",
"SUCCESS_FACTOR_URL": "https://performancemanager.successfactors.eu/sf/learning?company=learninghub",
"SVG_URL": "xml/topic$$$.svg",
"TOPIC_VAR": "$$$"
}
10 changes: 1 addition & 9 deletions src/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,7 @@ async function cookiePopup(page) {
async function navToSF(page) {
try {
console.info(`Navigating to SuccessFactor`);
const links = await page.$$(constant.SUCCESS_FACTOR_LINK_SELECTOR);
if (links.length <= 0) {
console.error("Can't find SuccessFactor Link");
return;
}
await page.evaluateHandle((el) => {
el.target = "_self";
}, links[0]);
await links[0].click();
await page.goto(constant.SUCCESS_FACTOR_URL, { followRedirect: true });
await redirection(page);
await redirection(page);
} catch (error) {
Expand Down

0 comments on commit 0ed0761

Please sign in to comment.