code: public static LayoutReport checkPageSpecLayout(WebDriver driver, PageSpec pageSpec, String[]includedTags, String[]excludedTags,
                                             String screenshotFilePath) throws IOException {
          TestSession session = TestSession.current();
          if (session == null) {
              throw new UnregisteredTestSession("Cannot check layout as there was no TestSession created");
          }
  
          TestReport report = session.getReport();
  
          File screenshotFile = null;
  
          if (screenshotFilePath != null) {
              screenshotFile = new File(screenshotFilePath);
              if (!screenshotFile.exists() || !screenshotFile.isFile()) {
                  throw new IOException("Couldn't find screenshot in " + screenshotFilePath);
              }
          }
  
          if (pageSpec == null) {
              throw new IOException("Page spec is not defined");
          }
  
          List<String> includedTagsList = toList(includedTags);
  
          LayoutReport layoutReport = Galen.checkLayout(new SeleniumBrowser(driver), pageSpec,
                  new SectionFilter(includedTagsList, toList(excludedTags)),
                  screenshotFile,
                  session.getListener());
  
          GalenUtils.attachLayoutReport(layoutReport, report, "<unknown>", includedTagsList);
          return layoutReport;
      }
docs: Used in GalenApi.js
  @param driver
  @param pageSpec
  @param includedTags
  @param excludedTags
  @param screenshotFilePath
  @return
  @throws IOException