diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 477e130649..0333281bc5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -83,33 +83,6 @@ jobs: run: | npm ci - - name: Run checks - run: | - npm run check - ./sbt headerCheck - - # oeq-ts-rest-api has its own ESLint checks seeing the ultimate plan - # is that it's moved to its own stand-alone repo. But so here we need - # to explicitly run them. - - name: Run checks (oeq-ts-rest-api) - working-directory: oeq-ts-rest-api - run: | - npm run lint - - - name: Run unit tests (java/scala) - run: | - ./sbt test - - - name: Run unit tests (javascript) - working-directory: react-front-end - run: | - npm cit - - - name: Run unit tests (javascript - legacy) - working-directory: Source/Plugins/Core/com.equella.core/test/javascript - run: | - npm cit - - name: Build primary artefacts run: | ./sbt installerZip writeLanguagePack writeScriptingJavadoc @@ -128,57 +101,6 @@ jobs: name: Artefacts path: artefacts.tar - build_storybook: - runs-on: ubuntu-latest - steps: - # Using v1 (rather than v2) through-out this workflow due to issue: - # https://github.com/actions/checkout/issues/237 - - uses: actions/checkout@v4 - - - name: NPM Cache - uses: actions/cache@v3 - with: - path: ~/.npm - key: ${{ runner.os }}-npm.storybook-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-npm.storybook- - - - name: Setup node - uses: actions/setup-node@v3 - with: - node-version-file: '.nvmrc' - - - name: Install node dependencies (oeq-rest-api) - working-directory: oeq-ts-rest-api - run: | - npm ci - - - name: Build oEQ REST module (oeq-rest-api) - working-directory: oeq-ts-rest-api - run: | - npm run build - - - name: Install node dependencies (core) - working-directory: react-front-end - run: | - npm ci - - - name: Generate Static Storybook instance - working-directory: react-front-end - run: | - npm run build-storybook - - - name: Package Static Storybook instance - working-directory: react-front-end - run: | - tar cvf storybook.tar storybook-static - - - name: Save Static Storybook instance - uses: actions/upload-artifact@v3.1.3 - with: - name: Storybook - path: react-front-end/storybook.tar - functional_testing: needs: build_and_check diff --git a/autotest/OldTests/src/test/java/com/tle/webtests/test/dashboard/PortalsTest.java b/autotest/OldTests/src/test/java/com/tle/webtests/test/dashboard/PortalsTest.java index 716e508aa0..a19bcca41f 100644 --- a/autotest/OldTests/src/test/java/com/tle/webtests/test/dashboard/PortalsTest.java +++ b/autotest/OldTests/src/test/java/com/tle/webtests/test/dashboard/PortalsTest.java @@ -32,6 +32,12 @@ import com.tle.webtests.pageobject.wizard.ContributePage; import com.tle.webtests.pageobject.wizard.WizardPageTab; import com.tle.webtests.test.AbstractCleanupTest; +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.ui.ExpectedCondition; +import org.openqa.selenium.support.ui.ExpectedConditions; +import org.openqa.selenium.support.ui.WebDriverWait; import org.testng.Assert; import org.testng.annotations.Test; @@ -285,7 +291,11 @@ public void testFreemarkerPortal() { } @Test - public void testRecentPortal() { + public void testRecentPortal() throws InterruptedException { + ExpectedCondition successMessage = + ExpectedConditions.visibilityOfElementLocated( + By.xpath("//*[contains(text(), 'Successfully saved')]")); + HomePage home = dash(); String recentName = context.getFullName("Recent Contributions Portal"); @@ -309,25 +319,24 @@ public void testRecentPortal() { wizard1.save().publish(); String draftItemName = context.getFullName("draft item"); + WizardPageTab wizard2 = new ContributePage(context).load().openWizard("Simple Controls Collection"); wizard2.editbox(1, draftItemName); - wizard2.save().draft(); + WebDriverWait waiter = wizard2.save().draft().getWaiter(); // Check that the live item is displayed - home = new MenuSection(context).home(); - RecentContributionsSection recent = new RecentContributionsSection(context, recentName).get(); - assertTrue(recent.recentContributionExists(liveItemName)); + assertTrue(waiter.until(waitForItem(recentName, liveItemName))); // Edit the portal + new MenuSection(context).home(); + RecentContributionsSection recent = new RecentContributionsSection(context, recentName).get(); RecentContributionsEditPage edit = recent.edit(portal); edit.setStatus("draft"); edit.checkSelectedCollection(); edit.save(new HomePage(context)); // Check that the draft item is displayed - home = new MenuSection(context).home(); - recent = new RecentContributionsSection(context, recentName).get(); assertTrue(recent.recentContributionExists(draftItemName)); String itemToQuery = context.getFullName("query item"); @@ -338,7 +347,7 @@ public void testRecentPortal() { wizard3.editbox(1, itemToQuery); wizard3.editbox(2, description); - wizard3.save().publish(); + wizard3.save().publish().getWaiter().until(successMessage); // Edit portlet for query option home = new MenuSection(context).home(); @@ -347,10 +356,11 @@ public void testRecentPortal() { edit.setStatus("live"); edit.checkSelectedCollection(); edit.save(new HomePage(context)); + // Check that the queried item is displayed - home = new MenuSection(context).home(); - recent = new RecentContributionsSection(context, recentName).get(); assertTrue(recent.recentContributionExists(itemToQuery)); + new MenuSection(context).home(); + recent = new RecentContributionsSection(context, recentName).get(); assertTrue(recent.descriptionExists(description, true)); // Edit portlet for description option @@ -362,7 +372,7 @@ public void testRecentPortal() { edit.save(new HomePage(context)); // Check that the description not displayed - home = new MenuSection(context).home(); + new MenuSection(context).home(); recent = new RecentContributionsSection(context, recentName).get(); assertFalse(recent.descriptionExists(description, false)); } @@ -442,4 +452,16 @@ protected void cleanupAfterClass() throws Exception { new DashboardAdminPage(context).load().deleteAll(prefix); super.cleanupAfterClass(); } + + private ExpectedCondition waitForItem(String sectionTitle, String itemName) { + return new ExpectedCondition() { + @Override + public Boolean apply(WebDriver driver) { + new MenuSection(context).home(); + RecentContributionsSection recent = + new RecentContributionsSection(context, sectionTitle).get(); + return recent.recentContributionExists(itemName); + } + }; + } } diff --git a/autotest/OldTests/src/test/java/io/github/openequella/pages/advancedsearch/NewAdvancedSearchPage.java b/autotest/OldTests/src/test/java/io/github/openequella/pages/advancedsearch/NewAdvancedSearchPage.java index ececfaa7c4..2680b28532 100644 --- a/autotest/OldTests/src/test/java/io/github/openequella/pages/advancedsearch/NewAdvancedSearchPage.java +++ b/autotest/OldTests/src/test/java/io/github/openequella/pages/advancedsearch/NewAdvancedSearchPage.java @@ -141,6 +141,7 @@ public void selectUser(String username) { // Open the dialog and search for the target user. userSelector.findElement(By.tagName("button")).click(); + WebElement dialog = driver.findElement(By.xpath("//div[@role='dialog']")); WebElement input = dialog.findElement(By.tagName("input")); input.sendKeys(username); diff --git a/autotest/Tests/src/main/java/com/tle/webtests/pageobject/portal/RecentContributionsSection.java b/autotest/Tests/src/main/java/com/tle/webtests/pageobject/portal/RecentContributionsSection.java index 0995f6f63a..6fc902f8d4 100644 --- a/autotest/Tests/src/main/java/com/tle/webtests/pageobject/portal/RecentContributionsSection.java +++ b/autotest/Tests/src/main/java/com/tle/webtests/pageobject/portal/RecentContributionsSection.java @@ -16,7 +16,6 @@ public boolean recentContributionExists(String itemName) { ".//div[normalize-space(@class)='recent-items']//a[normalize-space(text())=" + quoteXPath(itemName) + "]"); - waiter.until(ExpectedConditions.visibilityOfElementLocated(recentContributionXpath)); return isPresent(recentContributionXpath); }