Skip to content

Commit

Permalink
empty states when no test steps in the testcase (fixes #81, via #83)
Browse files Browse the repository at this point in the history
  • Loading branch information
todti authored Jan 31, 2025
1 parent c40cb24 commit 50e9690
Show file tree
Hide file tree
Showing 23 changed files with 110 additions and 21 deletions.
1 change: 1 addition & 0 deletions packages/web-awesome/src/components/BaseLayout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Footer } from "@/components/Footer";
import MainReport from "@/components/MainReport";
import Modal from "@/components/Modal";
import TestResult from "@/components/TestResult";
import TestResultEmpty from "@/components/TestResult/TestResultEmpty";
import { fetchStats, getLocale, getTheme } from "@/stores";
import { fetchPieChartData } from "@/stores/chart";
import { fetchEnvInfo } from "@/stores/envInfo";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { SvgIcon, allureIcons } from "@allurereport/web-components";
import { Text } from "@allurereport/web-components";
import { SvgIcon, Text, allureIcons } from "@allurereport/web-components";
import * as baseStyles from "@/components/BaseLayout/styles.scss";
import { TestResultInfo } from "@/components/TestResult/TestResultInfo";
import { useI18n } from "@/stores";
import * as styles from "./styles.scss";

const TestResultThumb = () => {
const { t } = useI18n("empty");
return (
<div className={styles["test-result-thumb"]}>
<div className={styles["test-result-thumb-wrapper"]}>
Expand All @@ -15,7 +16,7 @@ const TestResultThumb = () => {
id={allureIcons.lineDevCodeSquare}
className={styles["test-result-thumb-icon"]}
/>
<Text className={styles["test-result-thumb-text"]}>No test case results</Text>
<Text className={styles["test-result-thumb-text"]}>{t("no-test-case-results")}</Text>
</div>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ import { TestResultParameters } from "@/components/TestResult/TestResultParamete
import { TestResultSetup } from "@/components/TestResult/TestResultSetup";
import { TestResultSteps } from "@/components/TestResult/TestResultSteps";
import { TestResultTeardown } from "@/components/TestResult/TestResultTeardown";
import TestStepsEmpty from "@/components/TestResult/TestStepsEmpty";

export type TestResultOverviewProps = {
testResult?: AllureAwesomeTestResult;
};

export const TestResultOverview: FunctionalComponent<TestResultOverviewProps> = ({ testResult }) => {
const { error, parameters, groupedLabels, links, description, setup, steps, teardown } = testResult || {};
const isNoSteps = !setup?.length && !steps.length && !teardown.length;

return (
<>
Expand All @@ -31,6 +33,7 @@ export const TestResultOverview: FunctionalComponent<TestResultOverviewProps> =
{Boolean(links?.length) && <TestResultLinks links={links} />}
{Boolean(description) && <TestResultDescription description={description} />}
<div className={styles["test-results"]}>
{isNoSteps && <TestStepsEmpty />}
{Boolean(setup?.length) && <TestResultSetup setup={setup} />}
{Boolean(steps?.length) && <TestResultSteps steps={steps} />}
{Boolean(teardown?.length) && <TestResultTeardown teardown={teardown} />}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { SvgIcon, Text, allureIcons } from "@allurereport/web-components";
import { useI18n } from "@/stores";
import * as styles from "./styles.scss";

const TestStepsEmpty = () => {
const { t } = useI18n("empty");
return (
<div className={styles["test-steps-empty"]}>
<div className={styles["test-steps-empty-wrapper"]}>
<SvgIcon
size={"m"}
width={"32px"}
height={"32px"}
id={allureIcons.lineDevCodeSquare}
className={styles["test-steps-empty-icon"]}
/>
<Text className={styles["test-steps-empty-text"]}>{t("no-test-steps-results")}</Text>
</div>
</div>
);
};

export default TestStepsEmpty;
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.test-steps-empty {
display: flex;
justify-content: center;
flex-wrap: wrap;
min-height: 320px;
align-items: center;
}

.test-steps-empty-wrapper {
display: flex;
flex-direction: column;
align-items: center;
}

.test-steps-empty-icon {
width: 32px;
height: 32px;
margin-bottom: 16px;
flex: 1 1 auto;
}

.test-steps-empty-text {
color: var(--on-text-secondary);
flex: 1 1 auto;
}
4 changes: 3 additions & 1 deletion packages/web-awesome/src/i18n/locales/am.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@
"clear-filters": "Մաքրել ֆիլտրները",
"no-attachments-results": "Կցորդների մասին տեղեկություններ չկան",
"no-history-results": "Պատմության մասին տեղեկություններ չկան",
"no-retries-results": "Կրկնությունների մասին տեղեկություններ չկան"
"no-retries-results": "Կրկնությունների մասին տեղեկություններ չկան",
"no-test-steps-results": "Թեստի քայլերի մասին տեղեկատվությունը հասանելի չէ։",
"no-test-case-results": "Թեստի դեպքերի արդյունքներ չկան։"
},
"severity": {
"blocker": "արգելափակում",
Expand Down
4 changes: 3 additions & 1 deletion packages/web-awesome/src/i18n/locales/az.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@
"clear-filters": "Filtrləri təmizlə",
"no-attachments-results": "Əlavə məlumatı mövcud deyil",
"no-history-results": "Tarixçə məlumatı mövcud deyil",
"no-retries-results": "Təkrar məlumatı mövcud deyil"
"no-retries-results": "Təkrar məlumatı mövcud deyil",
"no-test-steps-results": "Test addımları haqqında məlumat mövcud deyil",
"no-test-case-results": "Test halları haqqında nəticələr yoxdur"
},
"severity": {
"blocker": "bloklayıcı",
Expand Down
4 changes: 3 additions & 1 deletion packages/web-awesome/src/i18n/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@
"clear-filters": "Filter löschen",
"no-attachments-results": "Keine Anhängeinformationen verfügbar",
"no-history-results": "Keine Verlaufsinformationen verfügbar",
"no-retries-results": "Keine Wiederholungsinformationen verfügbar"
"no-retries-results": "Keine Wiederholungsinformationen verfügbar",
"no-test-steps-results": "Keine Informationen zu Testschritten verfügbar",
"no-test-case-results": "Keine Testergebnisse verfügbar"
},
"severity": {
"blocker": "Blocker",
Expand Down
4 changes: 3 additions & 1 deletion packages/web-awesome/src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@
"clear-filters": "Clear filters",
"no-attachments-results": "No attachments information available",
"no-history-results": "No history information available",
"no-retries-results": "No retries information available"
"no-retries-results": "No retries information available",
"no-test-steps-results": "No test steps information available",
"no-test-case-results": "No test case results"
},
"severity": {
"blocker": "blocker",
Expand Down
4 changes: 3 additions & 1 deletion packages/web-awesome/src/i18n/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@
"clear-filters": "Limpiar filtros",
"no-attachments-results": "No hay información de adjuntos disponible",
"no-history-results": "No hay información de historial disponible",
"no-retries-results": "No hay información de reintentos disponible"
"no-retries-results": "No hay información de reintentos disponible",
"no-test-steps-results": "No hay información disponible sobre los pasos de prueba",
"no-test-case-results": "No hay resultados de casos de prueba"
},
"severity": {
"blocker": "bloqueante",
Expand Down
4 changes: 3 additions & 1 deletion packages/web-awesome/src/i18n/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@
"clear-filters": "Effacer les filtres",
"no-attachments-results": "Aucune information sur les pièces jointes disponible",
"no-history-results": "Aucune information sur l'historique disponible",
"no-retries-results": "Aucune information sur les réessais disponible"
"no-retries-results": "Aucune information sur les réessais disponible",
"no-test-steps-results": "Aucune information sur les étapes de test disponible",
"no-test-case-results": "Aucun résultat de cas de test"
},
"severity": {
"blocker": "bloquant",
Expand Down
4 changes: 3 additions & 1 deletion packages/web-awesome/src/i18n/locales/he.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@
"clear-filters": "נקה מסננים",
"no-attachments-results": "לא נמצאה מידע על קבצים מצורפים",
"no-history-results": "לא נמצאה מידע על היסטוריה",
"no-retries-results": "לא נמצאה מידע על נסיונות חוזרים"
"no-retries-results": "לא נמצאה מידע על נסיונות חוזרים",
"no-test-steps-results": "אין מידע על שלבי הבדיקה",
"no-test-case-results": "אין תוצאות של מקרי בדיקה"
},
"severity": {
"blocker": "חוסם",
Expand Down
4 changes: 3 additions & 1 deletion packages/web-awesome/src/i18n/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@
"clear-filters": "Cancella i filtri",
"no-attachments-results": "Nessuna informazione sugli allegati disponibile",
"no-history-results": "Nessuna informazione sulla cronologia disponibile",
"no-retries-results": "Nessuna informazione sui ritentativi disponibile"
"no-retries-results": "Nessuna informazione sui ritentativi disponibile",
"no-test-steps-results": "Nessuna informazione disponibile sui passaggi del test",
"no-test-case-results": "Nessun risultato dei casi di test"
},
"severity": {
"blocker": "bloccante",
Expand Down
4 changes: 3 additions & 1 deletion packages/web-awesome/src/i18n/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@
"clear-filters": "フィルターをクリア",
"no-attachments-results": "添付ファイル情報が利用できません",
"no-history-results": "履歴情報が利用できません",
"no-retries-results": "再試行情報が利用できません"
"no-retries-results": "再試行情報が利用できません",
"no-test-steps-results": "テスト手順の情報は利用できません",
"no-test-case-results": "テストケースの結果がありません"
},
"severity": {
"blocker": "ブロッカー",
Expand Down
4 changes: 3 additions & 1 deletion packages/web-awesome/src/i18n/locales/ka.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@
"clear-filters": "ფილტრების გასუფთავება",
"no-attachments-results": "დანართების ინფორმაცია არ არის ხელმისაწვდომი",
"no-history-results": "ისტორიის ინფორმაცია არ არის ხელმისაწვდომი",
"no-retries-results": "ხელახალი ცდების ინფორმ���ცია არ არის ხელმისაწვდომი"
"no-retries-results": "ხელახალი ცდების ინფორმ���ცია არ არის ხელმისაწვდომი",
"no-test-steps-results": "ტესტის ნაბიჯების ინფორმაცია ხელმისაწვდომი არ არის",
"no-test-case-results": "ტესტის შემთხვევის შედეგები არ არის"
},
"severity": {
"blocker": "ბლოკერი",
Expand Down
4 changes: 3 additions & 1 deletion packages/web-awesome/src/i18n/locales/kr.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@
"clear-filters": "필터 지우기",
"no-attachments-results": "첨부파일 정보를 사용할 수 없습니다",
"no-history-results": "기록 정보를 사용할 수 없습니다",
"no-retries-results": "재시도 정보를 사용할 수 없습니다"
"no-retries-results": "재시도 정보를 사용할 수 없습니다",
"no-test-steps-results": "테스트 단계 정보가 없습니다",
"no-test-case-results": "테스트 케이스 결과가 없습니다"
},
"severity": {
"blocker": "차단자",
Expand Down
4 changes: 3 additions & 1 deletion packages/web-awesome/src/i18n/locales/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@
"clear-filters": "Filters wissen",
"no-attachments-results": "Geen bijlageninformatie beschikbaar",
"no-history-results": "Geen geschiedenisinformatie beschikbaar",
"no-retries-results": "Geen herhalingsinformatie beschikbaar"
"no-retries-results": "Geen herhalingsinformatie beschikbaar",
"no-test-steps-results": "Geen informatie over teststappen beschikbaar",
"no-test-case-results": "Geen testresultaten"
},
"severity": {
"blocker": "blokkerend",
Expand Down
4 changes: 3 additions & 1 deletion packages/web-awesome/src/i18n/locales/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@
"clear-filters": "Wyczyść filtry",
"no-attachments-results": "Brak dostępnych informacji o załącznikach",
"no-history-results": "Brak dostępnych informacji o historii",
"no-retries-results": "Brak dostępnych informacji o ponownych próbach"
"no-retries-results": "Brak dostępnych informacji o ponownych próbach",
"no-test-steps-results": "Brak dostępnych informacji o krokach testowych",
"no-test-case-results": "Brak wyników przypadków testowych"
},
"severity": {
"name": "Ważność",
Expand Down
4 changes: 3 additions & 1 deletion packages/web-awesome/src/i18n/locales/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@
"clear-filters": "Limpar filtros",
"no-attachments-results": "Nenhuma informação de anexos disponível",
"no-history-results": "Nenhuma informação de histórico disponível",
"no-retries-results": "Nenhuma informação de repetições disponível"
"no-retries-results": "Nenhuma informação de repetições disponível",
"no-test-steps-results": "Nenhuma informação disponível sobre as etapas do teste",
"no-test-case-results": "Nenhum resultado de caso de teste"
},
"severity": {
"blocker": "bloqueador",
Expand Down
4 changes: 3 additions & 1 deletion packages/web-awesome/src/i18n/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@
"clear-filters": "Очистить фильтры",
"no-attachments-results": "Информация о вложениях отсутствует",
"no-history-results": "Информация об истории отсутствует",
"no-retries-results": "Информация о перезапусках отсутствует"
"no-retries-results": "Информация о перезапусках отсутствует",
"no-test-steps-results": "Нет информации о шагах тестирования",
"no-test-case-results": "Нет результатов тест-кейсов"
},
"severity": {
"name": "Важность",
Expand Down
4 changes: 3 additions & 1 deletion packages/web-awesome/src/i18n/locales/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@
"clear-filters": "Rensa filter",
"no-attachments-results": "Ingen bilaga information tillgänglig",
"no-history-results": "Ingen historik information tillgänglig",
"no-retries-results": "Ingen omtagningar information tillgänglig"
"no-retries-results": "Ingen omtagningar information tillgänglig",
"no-test-steps-results": "Ingen information om teststeg tillgänglig",
"no-test-case-results": "Inga testfallresultat"
},
"severity": {
"blocker": "blockerare",
Expand Down
4 changes: 3 additions & 1 deletion packages/web-awesome/src/i18n/locales/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@
"clear-filters": "Filtreleri temizle",
"no-attachments-results": "Ek bilgisi mevcut değil",
"no-history-results": "Geçmiş bilgisi mevcut değil",
"no-retries-results": "Tekrar deneme bilgisi mevcut değil"
"no-retries-results": "Tekrar deneme bilgisi mevcut değil",
"no-test-steps-results": "Test adımları hakkında bilgi mevcut değil",
"no-test-case-results": "Test vakası sonuçları yok"
},
"severity": {
"blocker": "engelleyici",
Expand Down
4 changes: 3 additions & 1 deletion packages/web-awesome/src/i18n/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@
"clear-filters": "清除过滤器",
"no-attachments-results": "没有附件信息",
"no-history-results": "没有历史信息",
"no-retries-results": "没有重试信息"
"no-retries-results": "没有重试信息",
"no-test-steps-results": "没有可用的测试步骤信息",
"no-test-case-results": "没有测试用例结果"
},
"severity": {
"blocker": "阻断",
Expand Down

0 comments on commit 50e9690

Please sign in to comment.