From fc401b03c969501276ee13bf2cf897ccba5a8672 Mon Sep 17 00:00:00 2001 From: Arul Date: Sat, 9 Aug 2025 01:17:31 +0530 Subject: [PATCH] Code Refined to Iterate and Fill Other Quests and Quest Rewards --- create-quests | 3 + .../com/ghost/temple/ReusableFunctions.java | 11 +- .../java/com/ghost/temple/pages/Quests.java | 2 +- storage.json | 2 +- sync-cookies | 4 + .../com/ghost/temple/ReusableFunctions.class | Bin 11209 -> 11355 bytes target/cucumber-report.html | 2 +- .../TEST-com.ghost.temple.TestRunner.xml | 133 +----------------- .../com.ghost.temple.TestRunner.txt | 36 +---- .../com/ghost/temple/pages/Quests.class | Bin 3414 -> 3450 bytes 10 files changed, 20 insertions(+), 173 deletions(-) create mode 100755 create-quests create mode 100755 sync-cookies diff --git a/create-quests b/create-quests new file mode 100755 index 0000000..3a2b831 --- /dev/null +++ b/create-quests @@ -0,0 +1,3 @@ +#!/bin/bash + +/usr/bin/mvn test diff --git a/src/main/java/com/ghost/temple/ReusableFunctions.java b/src/main/java/com/ghost/temple/ReusableFunctions.java index d549ddf..b7c169d 100644 --- a/src/main/java/com/ghost/temple/ReusableFunctions.java +++ b/src/main/java/com/ghost/temple/ReusableFunctions.java @@ -47,6 +47,7 @@ public static void fillQuestInputsAndRewards( WebElement titleElement, WebElement descElement, String createQuest, + WebElement createCustomQuest, List> questData, List dropdownXPaths, List> dropdownOptionsPerRow // each row has a list of dropdown/input values @@ -112,11 +113,13 @@ public static void fillQuestInputsAndRewards( } } - sleepInSeconds(4); - //Click Create Quest Button - //scrollIntoView(driver, createQuest); - //checkWebElement(createQuest); + sleepInSeconds(2); clickElementByXPathJS(driver, createQuest); + sleepInSeconds(2); + + if(rowIndex + 1 < questData.size()){ + click(createCustomQuest); + } } diff --git a/src/test/java/com/ghost/temple/pages/Quests.java b/src/test/java/com/ghost/temple/pages/Quests.java index 33a4efb..8c5977a 100644 --- a/src/test/java/com/ghost/temple/pages/Quests.java +++ b/src/test/java/com/ghost/temple/pages/Quests.java @@ -72,7 +72,7 @@ public class Quests { // Wait for the element to be clickable ReusableFunctions.waitForElementToBeVisible(driver, questTitle, 5); ReusableFunctions.waitForElementToBeVisible(driver, questDescription, 5); - ReusableFunctions.fillQuestInputsAndRewards(driver, questTitle, questDescription, createQuestBtnXpath, ExcelUtils.fetchQuestDataByColumns("Quests"), dropdownXpathList, ExcelUtils.fetchQuestDropdownOptions("Quests")); + ReusableFunctions.fillQuestInputsAndRewards(driver, questTitle, questDescription, createQuestBtnXpath, createCustomQuest, ExcelUtils.fetchQuestDataByColumns("Quests"), dropdownXpathList, ExcelUtils.fetchQuestDropdownOptions("Quests")); } } diff --git a/storage.json b/storage.json index 13bc98e..2d2563d 100644 --- a/storage.json +++ b/storage.json @@ -1 +1 @@ -{"localStorage":{"soloLevelUpUserStats":"{\"name\":\"Arul\",\"level\":1,\"exp\":0,\"expToNextLevel\":100,\"job\":null,\"title\":null,\"hp\":100,\"maxHp\":100,\"mp\":10,\"maxMp\":10,\"fatigue\":0,\"gold\":0,\"stats\":{\"str\":10,\"agi\":10,\"per\":10,\"int\":10,\"vit\":10},\"statPoints\":0,\"equipment\":[],\"quests\":[{\"title\":\"Offgrid Hermit - Disconnect from Internet\",\"description\":\"ghostTemple system forces user by disabling internet by default in the computer to go offgrid. Equiped with self designed /etc/host based porn blocker. It still provides user option to enable the internet at boot. asking user to enter password. to make user realize that their decision is conscious.\",\"reward\":\"Experience only\",\"difficulty\":\"S\",\"priority\":\"High\",\"expiry\":\"Daily\",\"expReward\":30,\"statPointsReward\":1,\"goldReward\":0,\"statRewards\":{\"str\":0,\"agi\":0,\"per\":0,\"int\":0,\"vit\":0},\"itemRewards\":[],\"id\":\"4564702d-396c-4f03-bc74-0496015c40aa\",\"active\":true,\"completed\":false,\"progress\":0,\"isCustom\":true,\"createdAt\":1754666927823},{\"title\":\"Offgrid Hermit - Disconnect from Internet\",\"description\":\"ghostTemple system forces user by disabling internet by default in the computer to go offgrid. Equiped with self designed /etc/host based porn blocker. It still provides user option to enable the internet at boot. asking user to enter password. to make user realize that their decision is conscious.\",\"reward\":\"Experience only\",\"difficulty\":\"S\",\"priority\":\"High\",\"expiry\":\"Daily\",\"expReward\":30,\"statPointsReward\":1,\"goldReward\":0,\"statRewards\":{\"str\":0,\"agi\":0,\"per\":0,\"int\":0,\"vit\":0},\"itemRewards\":[],\"id\":\"24625727-2d42-4177-a0de-910020c30f48\",\"active\":true,\"completed\":false,\"progress\":0,\"isCustom\":true,\"createdAt\":1754673484851},{\"title\":\"Offgrid Hermit - Disconnect from Internet\",\"description\":\"ghostTemple system forces user by disabling internet by default in the computer to go offgrid. Equiped with self designed /etc/host based porn blocker. It still provides user option to enable the internet at boot. asking user to enter password. to make user realize that their decision is conscious.\",\"reward\":\"Experience only\",\"difficulty\":\"S\",\"priority\":\"High\",\"expiry\":\"Daily\",\"expReward\":30,\"statPointsReward\":1,\"goldReward\":0,\"statRewards\":{\"str\":0,\"agi\":0,\"per\":0,\"int\":0,\"vit\":0},\"itemRewards\":[],\"id\":\"78bfd278-7ae8-4b8d-971b-1bfe5aa54e8d\",\"active\":true,\"completed\":false,\"progress\":0,\"isCustom\":true,\"createdAt\":1754673532100},{\"title\":\"Offgrid Hermit - Disconnect from Internet\",\"description\":\"ghostTemple system forces user by disabling internet by default in the computer to go offgrid. Equiped with self designed /etc/host based porn blocker. It still provides user option to enable the internet at boot. asking user to enter password. to make user realize that their decision is conscious.\",\"reward\":\"Experience only\",\"difficulty\":\"S\",\"priority\":\"High\",\"expiry\":\"Daily\",\"expReward\":30,\"statPointsReward\":1,\"goldReward\":0,\"statRewards\":{\"str\":0,\"agi\":0,\"per\":0,\"int\":0,\"vit\":0},\"itemRewards\":[],\"id\":\"c28b9c88-ddfd-4989-ba44-b60c3368123f\",\"active\":true,\"completed\":false,\"progress\":0,\"isCustom\":true,\"createdAt\":1754673709922}],\"completedQuests\":[],\"inventory\":[{\"id\":\"item-health-potion\",\"name\":\"Health Potion\",\"type\":\"Consumable\",\"rarity\":\"Common\",\"description\":\"Restores 100 HP when consumed.\",\"quantity\":3},{\"id\":\"item-mana-potion\",\"name\":\"Mana Potion\",\"type\":\"Consumable\",\"rarity\":\"Common\",\"description\":\"Restores 50 MP when consumed.\",\"quantity\":2}]}"},"sessionStorage":{}} \ No newline at end of file +{"localStorage":{"soloLevelUpUserStats":"{\"name\":\"Arul\",\"level\":1,\"exp\":30,\"expToNextLevel\":100,\"job\":null,\"title\":null,\"hp\":100,\"maxHp\":100,\"mp\":10,\"maxMp\":10,\"fatigue\":0,\"gold\":0,\"stats\":{\"str\":10,\"agi\":10,\"per\":10,\"int\":10,\"vit\":10},\"statPoints\":1,\"equipment\":[],\"quests\":[{\"title\":\"Offgrid Hermit - Disconnect from Internet\",\"description\":\"ghostTemple system forces user by disabling internet by default in the computer to go offgrid. Equiped with self designed /etc/host based porn blocker. It still provides user option to enable the internet at boot. asking user to enter password. to make user realize that their decision is conscious.\",\"reward\":\"Experience only\",\"difficulty\":\"S\",\"priority\":\"High\",\"expiry\":\"Daily\",\"expReward\":30,\"statPointsReward\":1,\"goldReward\":0,\"statRewards\":{\"str\":0,\"agi\":0,\"per\":0,\"int\":0,\"vit\":0},\"itemRewards\":[],\"id\":\"2c9d2590-5d0d-47bd-adcd-fcf1cc55f712\",\"active\":false,\"completed\":true,\"progress\":100,\"isCustom\":true,\"createdAt\":1754679761906,\"completedAt\":1754680173874},{\"title\":\"Offgrid Hermit - Disconnect from Internet\",\"description\":\"ghostTemple system forces user by disabling internet by default in the computer to go offgrid. Equiped with self designed /etc/host based porn blocker. It still provides user option to enable the internet at boot. asking user to enter password. to make user realize that their decision is conscious.\",\"reward\":\"Experience only\",\"difficulty\":\"S\",\"priority\":\"High\",\"expiry\":\"Daily\",\"expReward\":30,\"statPointsReward\":1,\"goldReward\":0,\"statRewards\":{\"str\":0,\"agi\":0,\"per\":0,\"int\":0,\"vit\":0},\"itemRewards\":[],\"id\":\"e41fbba2-6fc5-4a89-87ef-68c00b3b3be2\",\"active\":true,\"completed\":false,\"progress\":0,\"isCustom\":true,\"createdAt\":1754682145517},{\"title\":\"The Refiner - Appearance Leveling\",\"description\":\"Focusing on Skin health, Hair health, preventing Hair loss, Preventing Fat gain. Focused on Weight Loss and over all Hygiene the way we look. To Attract people and be charismatic.\",\"reward\":\"Experience only\",\"difficulty\":\"S\",\"priority\":\"High\",\"expiry\":\"Daily\",\"expReward\":30,\"statPointsReward\":1,\"goldReward\":0,\"statRewards\":{\"str\":0,\"agi\":0,\"per\":0,\"int\":0,\"vit\":0},\"itemRewards\":[],\"id\":\"8f2e8569-e24f-444f-952a-041b760c0294\",\"active\":true,\"completed\":false,\"progress\":0,\"isCustom\":true,\"createdAt\":1754682154296},{\"title\":\"King of Deception - Leveling up Art of Attraction\",\"description\":\"Focused on building a solid character. that is strong.. Talented, Attract people and seductive at same time. Manipulative in good way. Positive Manipulation by doing a good job on something we do and gaining trust among other people.\",\"reward\":\"Experience only\",\"difficulty\":\"S\",\"priority\":\"High\",\"expiry\":\"Daily\",\"expReward\":30,\"statPointsReward\":1,\"goldReward\":0,\"statRewards\":{\"str\":0,\"agi\":0,\"per\":0,\"int\":0,\"vit\":0},\"itemRewards\":[],\"id\":\"d99e97aa-2f8e-49fd-b95a-48151b968e2f\",\"active\":true,\"completed\":false,\"progress\":0,\"isCustom\":true,\"createdAt\":1754682163973},{\"title\":\"The Architect of Himself - Leveling up strength both physically and mentally\",\"description\":\"1. Exercise everyday Morning 1 hr (Cardio + strength) 2. Gain Knowledge on New concept or Technology, Read books. 3. Train Martial arts - Armed or Unarmed combat styles. Focus on Leveling up your Intellect, your Strength, Your Martial arts skill and your Aesthetics eventually.\",\"reward\":\"Experience only\",\"difficulty\":\"S\",\"priority\":\"High\",\"expiry\":\"Daily\",\"expReward\":30,\"statPointsReward\":1,\"goldReward\":0,\"statRewards\":{\"str\":0,\"agi\":0,\"per\":0,\"int\":0,\"vit\":0},\"itemRewards\":[],\"id\":\"af7940da-92d7-4ae8-8c79-54287f94dc6a\",\"active\":true,\"completed\":false,\"progress\":0,\"isCustom\":true,\"createdAt\":1754682175060},{\"title\":\"The Phoenix - Rise from Ashes\",\"description\":\"Keep Moving Forward, No matter what. No matter how much pain you face. you can do take breaks to learn from failures. But never quit . Never Settle. Accept your Pain. see it as a part of life. both physical and Mental Pain. If you can cure it you can cure them. but if you can't never use them as an excuse to be Lower. Always improve from pain and be strong if possible. the Key idea is not to stop at any cost and keep moving forward. Not to embrace pain or romanticize it.\",\"reward\":\"Experience only\",\"difficulty\":\"S\",\"priority\":\"High\",\"expiry\":\"Daily\",\"expReward\":30,\"statPointsReward\":1,\"goldReward\":0,\"statRewards\":{\"str\":0,\"agi\":0,\"per\":0,\"int\":0,\"vit\":0},\"itemRewards\":[],\"id\":\"d029572f-2731-4f4c-b02b-e132ca165d74\",\"active\":true,\"completed\":false,\"progress\":0,\"isCustom\":true,\"createdAt\":1754682188512}],\"completedQuests\":[\"2c9d2590-5d0d-47bd-adcd-fcf1cc55f712\"],\"inventory\":[{\"id\":\"item-health-potion\",\"name\":\"Health Potion\",\"type\":\"Consumable\",\"rarity\":\"Common\",\"description\":\"Restores 100 HP when consumed.\",\"quantity\":3},{\"id\":\"item-mana-potion\",\"name\":\"Mana Potion\",\"type\":\"Consumable\",\"rarity\":\"Common\",\"description\":\"Restores 50 MP when consumed.\",\"quantity\":2}]}"},"sessionStorage":{}} \ No newline at end of file diff --git a/sync-cookies b/sync-cookies new file mode 100755 index 0000000..fb7a200 --- /dev/null +++ b/sync-cookies @@ -0,0 +1,4 @@ +#!/bin/bash + +cp ~/solo-level-app-persistance-wrapper/storage.json . && cp ~/solo-level-app-persistance-wrapper/cookies.data . + diff --git a/target/classes/com/ghost/temple/ReusableFunctions.class b/target/classes/com/ghost/temple/ReusableFunctions.class index c0d1985ae00efb55ef9b51803ca744174416432b..eab63fb44ce9501b0194b43476a5d1d74ae1ac89 100644 GIT binary patch delta 3644 zcmbVO30PFu75>l6oBc7s$S^#X5fDLVK%iPBC`J<-5*09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