Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split Layout for Awesome #92

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 31 additions & 3 deletions packages/e2e/test/allure-awesome/testResult.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { expect, test } from "@playwright/test";
import { layer } from "allure-js-commons";
import { Stage, Status } from "allure-js-commons";
import { Stage, Status, layer } from "allure-js-commons";
import { type ReportBootstrap, boostrapReport, randomNumber } from "../utils/index.js";

let bootstrap: ReportBootstrap;
Expand Down Expand Up @@ -82,7 +81,6 @@ test.describe("allure-awesome", () => {
const randomLeaf = page.getByTestId("tree-leaf").nth(randomNumber(0, 4));

await randomLeaf.click();

const testTitleText = await page.getByTestId("test-result-info-title").textContent();
const navCounterText = await page.getByTestId("test-result-nav-current").textContent();
const pressPrevArrow = await page.getByTestId("test-result-nav-next").isDisabled();
Expand Down Expand Up @@ -135,4 +133,34 @@ test.describe("allure-awesome", () => {
await expect(page.getByTestId("test-result-error-trace")).toHaveText("broken test trace");
});
});

test.describe("Layout switching", () => {
test.beforeEach(async ({ page }) => {
await expect(page.getByTestId("base-layout")).toBeVisible();
});

test("should toggle from BaseLayout to SplitLayout with loader displayed correctly", async ({ page }) => {
await page.getByTestId("toggle-layout-button").click();

await expect(page.getByTestId("loader")).toBeVisible();

await expect(page.getByTestId("loader")).toBeHidden({ timeout: 1000 });

await expect(page.getByTestId("split-layout")).toBeVisible();
await expect(page.getByTestId("base-layout")).toBeHidden();
});

test("should toggle back from SplitLayout to BaseLayout with loader displayed correctly", async ({ page }) => {
await page.getByTestId("toggle-layout-button").click();
await expect(page.getByTestId("split-layout")).toBeVisible();

await page.getByTestId("toggle-layout-button").click();

await expect(page.getByTestId("loader")).toBeVisible();
await expect(page.getByTestId("loader")).toBeHidden({ timeout: 1000 });

await expect(page.getByTestId("base-layout")).toBeVisible();
await expect(page.getByTestId("split-layout")).toBeHidden();
});
});
});
3 changes: 3 additions & 0 deletions packages/plugin-awesome/src/generators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ export const generateStaticFiles = async (
reportDataFiles,
reportUuid,
allureVersion,
layout = "base",
} = payload;
const compile = Handlebars.compile(template);
const manifest = await readTemplateManifest(payload.singleFile);
Expand Down Expand Up @@ -301,6 +302,8 @@ export const generateStaticFiles = async (
createdAt: Date.now(),
reportUuid,
groupBy: groupBy?.length ? groupBy : ["parentSuite", "suite", "subSuite"],
layout,
allureVersion,
};
const html = compile({
headTags: headTags.join("\n"),
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-awesome/src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export type AllureAwesomeOptions = {
theme?: "light" | "dark";
reportLanguage?: "en" | "ru";
groupBy?: string[];
layout?: "base" | "split";
ci?: {
type: "github" | "jenkins";
url: string;
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-classic/src/generators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ export const generateStaticFiles = async (
createdAt: Date.now(),
reportUuid,
groupBy: groupBy?.length ? groupBy : ["parentSuite", "suite", "subSuite"],
allureVersion,
};
const html = compile({
headTags: headTags.join("\n"),
Expand Down
1 change: 1 addition & 0 deletions packages/web-awesome/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
"rimraf": "^6.0.1",
"sass": "^1.79.1",
"sass-loader": "^16.0.1",
"split.js": "^1.6.5",
"style-loader": "^4.0.0",
"svg-sprite-loader": "^6.0.11",
"typescript": "^5.6.3",
Expand Down
15 changes: 15 additions & 0 deletions packages/web-awesome/src/assets/scss/_common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,19 @@ body {
background: var(--bg-base-secondary);
font-family: var(--font-family);
-webkit-text-size-adjust: 100%;
//* > * {
// &::-webkit-scrollbar {
// width: 16px;
// }
//
// &::-webkit-scrollbar-thumb {
// border-radius: 10px;
// background: var(--scrollbar-color);
// border: 4px solid var(--bg-base-primary);
// }
//
// &::-webkit-scrollbar-thumb:hover {
// cursor: pointer;
// }
//}
}
2 changes: 1 addition & 1 deletion packages/web-awesome/src/assets/scss/index.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import "fonts.scss";
@import "typography.scss";
//@import "typography.scss";
@import "day.scss";
@import "night.scss";
@import "theme.scss";
Expand Down
2 changes: 2 additions & 0 deletions packages/web-awesome/src/assets/scss/theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
--on-text-hint: var(--on-text-hint-day);
--on-text-primary: var(--on-text-primary-day);
--on-text-secondary: var(--on-text-secondary-day);
--scrollbar-color: var(--gray-300);

color-scheme: light;
}
Expand Down Expand Up @@ -113,5 +114,6 @@
--on-text-primary: var(--on-text-primary-night);
--on-text-secondary: var(--on-text-secondary-night);

--scrollbar-color: var(--gray-400);
color-scheme: dark;
}
218 changes: 0 additions & 218 deletions packages/web-awesome/src/assets/scss/typography.scss

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
}

.arrow-button-m {
padding: 6px 6px;
padding: 4px 6px;
}

.icon-size-m {
Expand Down
Loading