package com.frameworkium.integration.frameworkium.tests;

import com.frameworkium.core.ui.tests.BaseUITest;
import com.frameworkium.integration.frameworkium.pages.JQueryDemoPage;
import com.frameworkium.integration.seleniumhq.pages.SeleniumDownloadPage;
import com.frameworkium.integration.theinternet.pages.WelcomePage;
import org.testng.annotations.*;

import static com.google.common.truth.Truth.assertThat;

public class FrameworkiumBugsTest extends BaseUITest {

    @BeforeMethod//(dependsOnMethods = "configureBrowserBeforeTest")
    public void configureBrowserBeforeUse_allows_browser_access_in_before_method() {
        configureBrowserBeforeUse();
        WelcomePage.open();
        tearDownBrowser();
    }

    public void ensure_jQueryAjaxDone_does_not_fail() {
        String headingText =
                JQueryDemoPage.open()
                        .waitForJQuery()
                        .getHeadingText();
        assertThat(headingText).isEqualTo("jQuery UI Demos");
    }

    public void use_base_page_visibility() {
        SeleniumDownloadPage.open()
                .hideContent()
                .forceVisibleContent()
                .waitForContent();
    }

    @Test(dependsOnMethods = {"use_base_page_visibility"})
    public void ensure_BaseUITest_wait_is_updated_after_browser_reset() {
        // tests bug whereby BasePage.wait wasn't updated after browser reset
        SeleniumDownloadPage.open().waitForContent();
    }

    public void use_base_page_logger() {
        SeleniumDownloadPage.open().log();
    }

}

@@ -258,66 +258,43 @@
 ort 
-com.frameworkium.integration.theinternet.pages.WelcomePage
+org.testng.annotations.BeforeMethod
 ;%0Aim
@@ -325,9 +325,12 @@
 ons.
-*
+Test
 ;%0A%0Ai
@@ -385,16 +385,108 @@
 tThat;%0A%0A
+// tests if BeforeMethods are run despite not being in this group%0A@Test(groups = %22fw-bugs%22)%0A
 public c
@@ -550,18 +550,16 @@
 reMethod
-//
 (depends
@@ -697,88 +697,58 @@
     
-configureBrowserBeforeUse();%0A        WelcomePage.open();%0A        tearDownBrowser
+assertThat(getDriver().getPageSource()).isNotEmpty
 ();%0A

Update @BeforeMethod test to use dependsOnMethods and removed page load