From e4954d84ea8969c25454b3550d00af5fa048b115 Mon Sep 17 00:00:00 2001 From: MustafaAgamy Date: Mon, 10 Feb 2025 16:29:38 +0200 Subject: [PATCH] Add Demo Projects to the User Guide (#266) * Add Parallel Execution Demo * Add SideBar Access * Fix Issues * Fix Issues * Fix Issues * Fix Parallel Repo Link Mobile Temp Page Added * Fix Parallel Repo Link Mobile Temp Page Added * Fix Parallel Repo Link Try the code snippet * Fix Parallel Repo Link Try the code snippet --------- Co-authored-by: MustafaAgamy Co-authored-by: MustafaAgamy --- docs/Demos/mobile.md | 11 +++++++++++ docs/Demos/web.md | 41 +++++++++++++++++++++++++++++++++++++++++ sidebars.js | 10 ++++++++++ 3 files changed, 62 insertions(+) create mode 100644 docs/Demos/mobile.md create mode 100644 docs/Demos/web.md diff --git a/docs/Demos/mobile.md b/docs/Demos/mobile.md new file mode 100644 index 00000000..9fa57921 --- /dev/null +++ b/docs/Demos/mobile.md @@ -0,0 +1,11 @@ +--- +id: mobile +title: Demo Projects For Mobile GUI +sidebar_label: Mobile +--- +### Basic Mobile GUI Automation Project + +:::info +You can visit this Repository to for a Demo on how to set Mobile GUI in SHAFT_ENGINE +### [BasicMobile_Demo](https://github.com/MustafaAgamy/ShaftEngine-ParellelWithThreadLocal.git) +::: \ No newline at end of file diff --git a/docs/Demos/web.md b/docs/Demos/web.md new file mode 100644 index 00000000..cea3baaa --- /dev/null +++ b/docs/Demos/web.md @@ -0,0 +1,41 @@ +--- +id: web +title: Demo Projects For Web GUI +sidebar_label: Web +--- +### Parallel Execution using ThreadLocal Driver + +```java title="ParallelThreadLocalSampleTest" +public class ParallelThreadLocalTest { + private ThreadLocal driver = new ThreadLocal<>(); + private SHAFT.TestData.JSON testData; + + @Test + public void signOutTest() { + new HomePage(driver.get()) + .signOut(); + } + + @Test + public void buttonClickTest() { + new HomePage(driver.get()) + .clickMe(); + } + + @BeforeMethod + public void beforeMethodSetUp() { + driver.set(new SHAFT.GUI.WebDriver()); + driver.get().browser().navigateToURL("url"); + } + + @AfterMethod + public void afterMethodTearDown() { + driver.get().quit(); + } +} +``` + +:::info +You can visit this Repository to for a Demo on how to set Parallel Execution in SHAFT_ENGINE +### [ParallelExecution_Demo](https://github.com/MustafaAgamy/ShaftEngine-ParellelWithThreadLocal.git) +::: \ No newline at end of file diff --git a/sidebars.js b/sidebars.js index 1dc65397..32eac0ba 100644 --- a/sidebars.js +++ b/sidebars.js @@ -121,6 +121,16 @@ const sidebars = { "Properties/PropertiesList", ], }, + { + type: 'category', + label: 'Demos', + collapsible: true, + collapsed: true, + items: [ + "Demos/web", + "Demos/mobile", + ], + }, ], };