diff --git a/arkui/ace_ets_module_ui/ace_ets_module_theme/ace_ets_module_theme_hvigor/entry/src/main/ets/MainAbility/pages/components/SwiperPage.ets b/arkui/ace_ets_module_ui/ace_ets_module_theme/ace_ets_module_theme_hvigor/entry/src/main/ets/MainAbility/pages/components/SwiperPage.ets index 449f95705d48434e98e0b9c325df2acdef3489f5..49f6c4c3da57cd2e20f40af2d7220614251dbc88 100644 --- a/arkui/ace_ets_module_ui/ace_ets_module_theme/ace_ets_module_theme_hvigor/entry/src/main/ets/MainAbility/pages/components/SwiperPage.ets +++ b/arkui/ace_ets_module_ui/ace_ets_module_theme/ace_ets_module_theme_hvigor/entry/src/main/ets/MainAbility/pages/components/SwiperPage.ets @@ -12,89 +12,183 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { redCustomTheme } from '../../themes/CustomTheme'; +import { brownCustomTheme, redCustomTheme } from '../../themes/CustomTheme'; import { CustomTheme } from '@ohos.arkui.theme'; + export const swiperThemeProperty = 'SwiperThemeProperty'; +export const swiperThemeSetProperty = 'SwiperThemeSetProperty'; export class SwiperKeys { public static readonly dotIndicatorSystem = `Swiper_DotIndicator_System`; - public static readonly dotIndicatorWithTheme = `Swiper_DotIndicator_WithTheme`; - public static readonly digitIndicatorSystem = `Swiper_DigitIndicator_System`; - public static readonly digitIndicatorWithTheme = `Swiper_DigitIndicator_WithTheme`; + public static readonly dotIndicatorSystemCustomAttrs = `Swiper_DotIndicator_System_CustomAttrs` + public static readonly digitIndicatorSystem = `Swiper_DigitIndicator_System` + public static readonly digitIndicatorSystemCustomAttrs = `Swiper_DigitIndicator_System_CustomAttrs` + public static readonly dotIndicatorWithTheme = `Swiper_DotIndicator_WithTheme` + public static readonly dotIndicatorWithThemeCustomAttrs = `Swiper_DotIndicator_WithTheme_CustomAttrs` + public static readonly digitIndicatorWithTheme = `Swiper_DigitIndicator_WithTheme` + public static readonly digitIndicatorWithThemeCustomAttrs = `Swiper_DigitIndicator_WithTheme_CustomAttrs` +} + +export class SwiperTextKeys { + public static readonly dotIndicatorTextSystem = `Swiper_Text_DotIndicator_System` + public static readonly digitIndicatorTextSystem = `Swiper_Text_DigitIndicator_System` + public static readonly dotIndicatorTextWithTheme = `Swiper_Text_DotIndicator_WithTheme` + public static readonly digitIndicatorTextWithTheme = `Swiper_Text_DigitIndicator_WithTheme` } @Entry @Component struct SwiperPage { @StorageLink(swiperThemeProperty) localTheme: CustomTheme | undefined = redCustomTheme; + @StorageLink(swiperThemeSetProperty) themeSet: boolean = true value: string = 'Text'; data: string[] = ['1', '2', '3', '4', '5']; build() { - Column() { - Swiper() { - ForEach(this.data, (item: string) => { - Text(item) - .width('90%') - .height('160vp') - .backgroundColor('#AFEEEE') - .textAlign(TextAlign.Center) - .fontSize('30fp') - }) - } - .indicator(new DotIndicator()) - .displayArrow({ showBackground: true }) - .margin({ top: '10vp' }) - .key(SwiperKeys.dotIndicatorSystem) - - WithTheme({ theme: this.localTheme }) { + Scroll() { + Column() { Swiper() { ForEach(this.data, (item: string) => { Text(item) .width('90%') .height('160vp') - .backgroundColor('#AFEEEE') .textAlign(TextAlign.Center) .fontSize('30fp') + .key(SwiperTextKeys.dotIndicatorTextSystem) }) } .indicator(new DotIndicator()) .displayArrow({ showBackground: true }) .margin({ top: '10vp' }) - .key(SwiperKeys.dotIndicatorWithTheme) - } + .key(SwiperKeys.dotIndicatorSystem) - Swiper() { - ForEach(this.data, (item: string) => { - Text(item) - .width('90%') - .height('160vp') - .backgroundColor('#AFEEEE') - .textAlign(TextAlign.Center) - .fontSize('30fp') - }) - } - .indicator(new DigitIndicator()) - .margin({ top: '10vp' }) - .key(SwiperKeys.digitIndicatorSystem) + Swiper() { + ForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height('160vp') + .textAlign(TextAlign.Center) + .fontSize('30fp') + }) + } + .indicator(new DotIndicator() + .color(brownCustomTheme.colors?.compBackgroundSecondary) + .selectedColor(brownCustomTheme.colors?.compBackgroundEmphasize) + ) + .displayArrow({ showBackground: true, + arrowColor: brownCustomTheme.colors?.iconPrimary, + backgroundColor: brownCustomTheme.colors?.compBackgroundSecondary}) + .margin({ top: '10vp' }) + .key(SwiperKeys.dotIndicatorSystemCustomAttrs) - WithTheme({ theme: this.localTheme }) { Swiper() { ForEach(this.data, (item: string) => { Text(item) .width('90%') .height('160vp') - .backgroundColor('#AFEEEE') .textAlign(TextAlign.Center) .fontSize('30fp') + .key(SwiperTextKeys.digitIndicatorTextSystem) }) } + .displayArrow({ showBackground: true}) .indicator(new DigitIndicator()) .margin({ top: '10vp' }) - .key(SwiperKeys.digitIndicatorWithTheme) + .key(SwiperKeys.digitIndicatorSystem) + + Swiper() { + ForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height('160vp') + .textAlign(TextAlign.Center) + .fontSize('30fp') + }) + } + .indicator(new DigitIndicator() + .fontColor(brownCustomTheme.colors?.fontPrimary) + .selectedFontColor(brownCustomTheme.colors?.fontPrimary) + ) + .displayArrow({ showBackground: true, + arrowColor: brownCustomTheme.colors?.iconPrimary, + backgroundColor: brownCustomTheme.colors?.compBackgroundSecondary}) + .margin({ top: '10vp' }) + .key(SwiperKeys.digitIndicatorSystemCustomAttrs) + + WithTheme({ theme: this.themeSet ? this.localTheme : undefined }) { + Column() { + Swiper() { + ForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height('160vp') + .textAlign(TextAlign.Center) + .fontSize('30fp') + .key(SwiperTextKeys.dotIndicatorTextWithTheme) + }) + } + .indicator(new DotIndicator()) + .displayArrow({ showBackground: true }) + .margin({ top: '10vp' }) + .key(SwiperKeys.dotIndicatorWithTheme) + + Swiper() { + ForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height('160vp') + .textAlign(TextAlign.Center) + .fontSize('30fp') + }) + } + .indicator(new DotIndicator() + .color(brownCustomTheme.colors?.compBackgroundSecondary) + .selectedColor(brownCustomTheme.colors?.compBackgroundEmphasize) + ) + .displayArrow({ showBackground: true, + arrowColor: brownCustomTheme.colors?.iconPrimary, + backgroundColor: brownCustomTheme.colors?.compBackgroundSecondary}) + .margin({ top: '10vp' }) + .key(SwiperKeys.dotIndicatorWithThemeCustomAttrs) + + Swiper() { + ForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height('160vp') + .textAlign(TextAlign.Center) + .fontSize('30fp') + .key(SwiperTextKeys.digitIndicatorTextWithTheme) + }) + } + .displayArrow({ showBackground: true}) + .indicator(new DigitIndicator()) + .margin({ top: '10vp' }) + .key(SwiperKeys.digitIndicatorWithTheme) + + Swiper() { + ForEach(this.data, (item: string) => { + Text(item) + .width('90%') + .height('160vp') + .textAlign(TextAlign.Center) + .fontSize('30fp') + }) + } + .indicator(new DigitIndicator() + .fontColor(brownCustomTheme.colors?.fontPrimary) + .selectedFontColor(brownCustomTheme.colors?.fontPrimary) + ) + .displayArrow({ showBackground: true, + arrowColor: brownCustomTheme.colors?.iconPrimary, + backgroundColor: brownCustomTheme.colors?.compBackgroundSecondary}) + .margin({ top: '10vp' }) + .key(SwiperKeys.digitIndicatorWithThemeCustomAttrs) + } + } } + .width('100%') } - .width('100%') } } \ No newline at end of file diff --git a/arkui/ace_ets_module_ui/ace_ets_module_theme/ace_ets_module_theme_hvigor/entry/src/main/ets/test/components/Swiper.test.ets b/arkui/ace_ets_module_ui/ace_ets_module_theme/ace_ets_module_theme_hvigor/entry/src/main/ets/test/components/Swiper.test.ets index 9120eb9c087691a81b0f8f4c9bfae83d9dc2afa2..9a48795f482e876482efda41d6c30ca5f6b88115 100644 --- a/arkui/ace_ets_module_ui/ace_ets_module_theme/ace_ets_module_theme_hvigor/entry/src/main/ets/test/components/Swiper.test.ets +++ b/arkui/ace_ets_module_ui/ace_ets_module_theme/ace_ets_module_theme_hvigor/entry/src/main/ets/test/components/Swiper.test.ets @@ -14,19 +14,50 @@ */ import { afterAll, beforeAll, beforeEach, describe, it, expect } from '@ohos/hypium' import router from '@ohos.router' -import { SwiperKeys, swiperThemeProperty } from '../../MainAbility/pages/components/SwiperPage' -import { greenCustomTheme, redCustomTheme } from '../../MainAbility/themes/CustomTheme' +import { SwiperKeys, SwiperTextKeys, swiperThemeProperty, swiperThemeSetProperty } from '../../MainAbility/pages/components/SwiperPage' +import { brownCustomTheme, greenCustomTheme, redCustomTheme } from '../../MainAbility/themes/CustomTheme' import { frameTime, sleep } from '../Utils' import { Theme, CustomTheme } from '@ohos.arkui.theme' import { colorValuesKey } from '../../MainAbility/pages/index/index' +const EMPTY_CHECK: string = 'emptyCheck'; +const EMPTY_ATTR: string = 'emptyAttr'; + export default function swiperThemeTest() { const SUITE: string = `SwiperThemeTest` - const EMPTY_CHECK: string = 'emptyCheck'; - const EMPTY_ATTR: string = 'emptyAttr'; - let localTheme: CustomTheme | undefined; - let changeTheme: boolean = false; + // themes for each testcase + const themes: (CustomTheme | undefined)[] = [ + redCustomTheme, + redCustomTheme, + greenCustomTheme, + undefined + ] + + // testcase index: starting with -1 to get 0 in 1st testcase + let index: number = -1; + + const swiperDotKeys: string[] = [ + SwiperKeys.dotIndicatorSystem, + SwiperKeys.dotIndicatorSystemCustomAttrs, + SwiperKeys.dotIndicatorWithTheme, + SwiperKeys.dotIndicatorWithThemeCustomAttrs + ] + + const swiperDigitKeys: string[] = [ + SwiperKeys.digitIndicatorSystem, + SwiperKeys.digitIndicatorSystemCustomAttrs, + SwiperKeys.digitIndicatorWithTheme, + SwiperKeys.digitIndicatorWithThemeCustomAttrs + ] + + const swiperTextKeys: string[] = [ + SwiperTextKeys.dotIndicatorTextSystem, + SwiperTextKeys.digitIndicatorTextSystem, + SwiperTextKeys.dotIndicatorTextWithTheme, + SwiperTextKeys.digitIndicatorTextWithTheme + ] + let colorValues: Map | undefined = new Map(); describe(SUITE, () => { @@ -38,7 +69,6 @@ export default function swiperThemeTest() { let pages: router.RouterState = router.getState(); if (pages?.name !== `SwiperPage`) { await router.pushUrl(options).then(() => { - localTheme = AppStorage.get(swiperThemeProperty); console.info(`${SUITE} router.pushUrl success`); }) } @@ -49,15 +79,17 @@ export default function swiperThemeTest() { }); beforeEach(() => { - if (!changeTheme) return - if ((AppStorage.get(swiperThemeProperty) as Theme)?.colors?.fontEmphasize - == redCustomTheme?.colors?.fontEmphasize) { - AppStorage.setOrCreate(swiperThemeProperty, greenCustomTheme); + // setting preconditions for each testcase + index = index + 1 + // if theme is empty + if (themes[index] === undefined) { + // sending themeSet=false to SwiperPage to use withTheme(undefined) + AppStorage.setOrCreate(swiperThemeSetProperty, false) } else { - AppStorage.setOrCreate(swiperThemeProperty, redCustomTheme); + // sending theme=current theme to SwiperPage to use withTheme(current theme) + AppStorage.setOrCreate(swiperThemeProperty, themes[index] ?? redCustomTheme) + AppStorage.setOrCreate(swiperThemeSetProperty, true) } - localTheme = AppStorage.get(swiperThemeProperty); - changeTheme = false; }); afterAll(() => { @@ -79,44 +111,18 @@ export default function swiperThemeTest() { it(`ActsSwiperThemeColors_0100`, 0, () => { const CASE: string = `ActsSwiperThemeColors_0100`; console.info(`${SUITE} ${CASE} START`); - { - const json = getInspectorByKey(SwiperKeys.dotIndicatorSystem); - const indicatorJson: string = JSON.parse(json)?.$attrs?.indicator?.toString(); - const indicatorColor: string = JSON.parse(indicatorJson)?.color?.toString().toUpperCase() ?? EMPTY_ATTR; - const indicatorSelectedColor: string = JSON.parse(indicatorJson)?.selectedColor?.toString().toUpperCase() - ?? EMPTY_ATTR; - const arrowColor: string = JSON.parse(json)?.$attrs?.arrowColor?.toString().toUpperCase() ?? EMPTY_ATTR; - const arrowBackgroundColor: string = JSON.parse(json)?.$attrs?.arrowBackgroundColor?.toString().toUpperCase() - ?? EMPTY_ATTR; - - const checkIndicatorColor: string = colorValues?.get(`compBackgroundSecondary`)?.toString().toUpperCase() - ?? EMPTY_CHECK; - const checkIndicatorSelectedColor: string = colorValues?.get(`compBackgroundEmphasize`)?. - toString().toUpperCase() ?? EMPTY_CHECK; - const checkArrowColor: string = colorValues?.get(`iconPrimary`)?.toString().toUpperCase() ?? EMPTY_CHECK; - const checkArrowBackgroundColor: string = colorValues?.get(`compBackgroundSecondary`)?.toString().toUpperCase() - ?? EMPTY_CHECK; - - expect(indicatorColor).assertEqual(checkIndicatorColor); - expect(indicatorSelectedColor).assertEqual(checkIndicatorSelectedColor); - expect(arrowColor).assertEqual(checkArrowColor); - expect(arrowBackgroundColor).assertEqual(checkArrowBackgroundColor); - } - - { - const json = getInspectorByKey(SwiperKeys.digitIndicatorSystem); - const indicatorJson: string = JSON.parse(json)?.$attrs?.indicator; - const fontColor: string = JSON.parse(indicatorJson)?.fontColor?.toString().toUpperCase() ?? EMPTY_ATTR; - const selectedFontColor: string = JSON.parse(indicatorJson)?.selectedFontColor?.toString().toUpperCase() ?? EMPTY_ATTR; - - const checkFontColor: string = colorValues?.get(`fontPrimary`)?.toString().toUpperCase() ?? EMPTY_CHECK; - const checkSelectedFontColor: string = colorValues?.get(`fontPrimary`)?.toString().toUpperCase() - ?? EMPTY_CHECK; - - expect(fontColor).assertEqual(checkFontColor); - expect(selectedFontColor).assertEqual(checkSelectedFontColor); - } - + swiperDotKeys.forEach((key) => { + if (key.search(`WithTheme`) > 0) return + checkDotWithTheme(key, undefined, key.search(`CustomAttrs`) > 0, colorValues) + }) + swiperDigitKeys.forEach((key) => { + if (key.search(`WithTheme`) > 0) return + checkDigitWithTheme(key, undefined, key.search(`CustomAttrs`) > 0, colorValues) + }) + swiperTextKeys.forEach((key) => { + if (key.search(`WithTheme`) > 0) return + checkTextWithTheme(key, undefined, colorValues) + }) console.info(`${SUITE} ${CASE} END`) }); @@ -131,46 +137,18 @@ export default function swiperThemeTest() { it(`ActsSwiperThemeColors_0200`, 0, () => { let CASE: string = `ActsSwiperThemeColors_0200`; console.info(`${SUITE} ${CASE} START`); - { - const json = getInspectorByKey(SwiperKeys.dotIndicatorWithTheme); - const indicatorJson: string = JSON.parse(json)?.$attrs?.indicator?.toString(); - const indicatorColor: string = JSON.parse(indicatorJson)?.color?.toString().toUpperCase() ?? EMPTY_ATTR; - const indicatorSelectedColor: string = JSON.parse(indicatorJson)?.selectedColor?.toString().toUpperCase() - ?? EMPTY_ATTR; - const arrowColor: string = JSON.parse(json)?.$attrs?.arrowColor?.toString().toUpperCase() ?? EMPTY_ATTR; - const arrowBackgroundColor: string = JSON.parse(json)?.$attrs?.arrowBackgroundColor?.toString().toUpperCase() - ?? EMPTY_ATTR; - - const checkIndicatorColor: string = localTheme?.colors?.compBackgroundSecondary?.toString().toUpperCase() - ?? EMPTY_CHECK; - const checkIndicatorSelectedColor: string = localTheme?.colors?.compBackgroundEmphasize?. - toString().toUpperCase() ?? EMPTY_CHECK; - const checkArrowColor: string = localTheme?.colors?.iconPrimary?.toString().toUpperCase() ?? EMPTY_CHECK; - const checkArrowBackgroundColor: string = localTheme?.colors?.compBackgroundSecondary?.toString().toUpperCase() - ?? EMPTY_CHECK; - - expect(indicatorColor).assertEqual(checkIndicatorColor); - expect(indicatorSelectedColor).assertEqual(checkIndicatorSelectedColor); - expect(arrowColor).assertEqual(checkArrowColor); - expect(arrowBackgroundColor).assertEqual(checkArrowBackgroundColor); - } - - { - const json = getInspectorByKey(SwiperKeys.digitIndicatorWithTheme); - const indicatorJson: string = JSON.parse(json)?.$attrs?.indicator?.toString(); - const fontColor: string = JSON.parse(indicatorJson)?.fontColor?.toString().toUpperCase() ?? EMPTY_ATTR; - const selectedFontColor: string = JSON.parse(indicatorJson)?.selectedFontColor?.toString().toUpperCase() - ?? EMPTY_ATTR; - - const checkFontColor: string = localTheme?.colors?.fontPrimary?.toString().toUpperCase() ?? EMPTY_CHECK; - const checkSelectedFontColor: string = localTheme?.colors?.fontPrimary?.toString().toUpperCase() - ?? EMPTY_CHECK; - - expect(fontColor).assertEqual(checkFontColor); - expect(selectedFontColor).assertEqual(checkSelectedFontColor); - } - - changeTheme = true; + swiperDotKeys.forEach((key) => { + if (key.search(`System`) > 0) return + checkDotWithTheme(key, themes[index], key.search(`CustomAttrs`) > 0, colorValues) + }) + swiperDigitKeys.forEach((key) => { + if (key.search(`System`) > 0) return + checkDigitWithTheme(key, themes[index], key.search(`CustomAttrs`) > 0, colorValues) + }) + swiperTextKeys.forEach((key) => { + if (key.search(`System`) > 0) return + checkTextWithTheme(key, themes[index], colorValues) + }) console.info(`${SUITE} ${CASE} END`); }); @@ -187,46 +165,108 @@ export default function swiperThemeTest() { const CASE: string = `ActsSwiperThemeColors_0300`; console.info(`${SUITE} ${CASE} START`); await sleep(frameTime); - { - const json = getInspectorByKey(SwiperKeys.dotIndicatorWithTheme) - const indicatorJson: string = JSON.parse(json)?.$attrs?.indicator?.toString() - const indicatorColor: string = JSON.parse(indicatorJson)?.color?.toString().toUpperCase() ?? EMPTY_ATTR; - const indicatorSelectedColor: string = JSON.parse(indicatorJson)?.selectedColor?.toString().toUpperCase() - ?? EMPTY_ATTR; - const arrowColor: string = JSON.parse(json)?.$attrs?.arrowColor?.toString().toUpperCase() ?? EMPTY_ATTR; - const arrowBackgroundColor: string = JSON.parse(json)?.$attrs?.arrowBackgroundColor?.toString().toUpperCase() - ?? EMPTY_ATTR; - - const checkIndicatorColor: string = localTheme?.colors?.compBackgroundSecondary?.toString().toUpperCase() - ?? EMPTY_CHECK; - const checkIndicatorSelectedColor: string = localTheme?.colors?.compBackgroundEmphasize?. - toString().toUpperCase() ?? EMPTY_CHECK; - const checkArrowColor: string = localTheme?.colors?.iconPrimary?.toString().toUpperCase() ?? EMPTY_CHECK; - const checkArrowBackgroundColor: string = localTheme?.colors?.compBackgroundSecondary?.toString().toUpperCase() - ?? EMPTY_CHECK; - - expect(indicatorColor).assertEqual(checkIndicatorColor); - expect(indicatorSelectedColor).assertEqual(checkIndicatorSelectedColor); - expect(arrowColor, checkArrowColor); - expect(arrowBackgroundColor, checkArrowBackgroundColor); - } - - { - const json = getInspectorByKey(SwiperKeys.digitIndicatorWithTheme); - const indicatorJson: string = JSON.parse(json)?.$attrs?.indicator?.toString(); - const fontColor: string = JSON.parse(indicatorJson)?.fontColor?.toString(); - const selectedFontColor: string = JSON.parse(indicatorJson)?.selectedFontColor?.toString(); - - const checkFontColor: string = localTheme?.colors?.fontPrimary?.toString().toUpperCase() ?? EMPTY_CHECK; - const checkSelectedFontColor: string = localTheme?.colors?.fontPrimary?.toString().toUpperCase() - ?? EMPTY_CHECK; - - expect(fontColor, checkFontColor); - expect(selectedFontColor, checkSelectedFontColor); - } + swiperDotKeys.forEach((key) => { + if (key.search(`System`) > 0) return + checkDotWithTheme(key, themes[index], key.search(`CustomAttrs`) > 0, colorValues) + }) + swiperDigitKeys.forEach((key) => { + if (key.search(`System`) > 0) return + checkDigitWithTheme(key, themes[index], key.search(`CustomAttrs`) > 0, colorValues) + }) + swiperTextKeys.forEach((key) => { + if (key.search(`System`) > 0) return + checkTextWithTheme(key, themes[index], colorValues) + }) + console.info(`${SUITE} ${CASE} END`); + }); - changeTheme = true; + /** + * @tc.number : ActsSwiperThemeColors_0400 + * @tc.name : ActsSwiperThemeColors_0400 + * @tc.desc : Check system colors values of Swiper component + * after changing the theme + * @tc.level : Level 2 + * @tc.size : MediumTest + * @tc.type : Function + */ + it(`ActsSwiperThemeColors_0400`, 0, async () => { + const CASE: string = `ActsSwiperThemeColors_0400`; + console.info(`${SUITE} ${CASE} START`); + await sleep(frameTime); + swiperDotKeys.forEach((key) => { + checkDotWithTheme(key, undefined, key.search(`CustomAttrs`) > 0, colorValues) + }) + swiperDigitKeys.forEach((key) => { + checkDigitWithTheme(key, undefined, key.search(`CustomAttrs`) > 0, colorValues) + }) + swiperTextKeys.forEach((key) => { + checkTextWithTheme(key, undefined, colorValues) + }) console.info(`${SUITE} ${CASE} END`); }); }); +} + +function checkDotWithTheme(key: string, localTheme: CustomTheme | undefined, customAttrs: boolean, colorValues: Map | undefined) { + let swiperJson = getInspectorByKey(key) + let indicatorJson: string = JSON.parse(swiperJson)?.$attrs?.indicator?.toString() + let indicatorColor: string = JSON.parse(indicatorJson)?.color?.toString() ?? EMPTY_ATTR + let checkIndicatorColor: string = (customAttrs ? brownCustomTheme : localTheme)?.colors?.compBackgroundSecondary?.toString() + ?? colorValues?.get('compBackgroundSecondary') + ?? EMPTY_CHECK + expect(indicatorColor).assertEqual(checkIndicatorColor) + + let indicatorSelectedColor: string = JSON.parse(indicatorJson)?.selectedColor?.toString() ?? EMPTY_ATTR + let checkIndicatorSelectedColor: string = (customAttrs ? brownCustomTheme : localTheme)?.colors?.compBackgroundEmphasize?.toString() + ?? colorValues?.get('compBackgroundEmphasize') + ?? EMPTY_CHECK + expect(indicatorSelectedColor).assertEqual(checkIndicatorSelectedColor) + + let arrowColor: string = JSON.parse(swiperJson)?.$attrs?.arrowColor?.toString() ?? EMPTY_ATTR + let checkArrowColor: string = (customAttrs ? brownCustomTheme : localTheme)?.colors?.iconPrimary?.toString() + ?? colorValues?.get('iconPrimary') + ?? EMPTY_CHECK + expect(arrowColor).assertEqual(checkArrowColor) + + let arrowBackgroundColor: string = JSON.parse(swiperJson)?.$attrs?.arrowBackgroundColor?.toString() ?? EMPTY_ATTR + let checkArrowBackgroundColor: string = (customAttrs ? brownCustomTheme : localTheme)?.colors?.compBackgroundSecondary?.toString() + ?? colorValues?.get('compBackgroundSecondary') + ?? EMPTY_CHECK + expect(arrowBackgroundColor).assertEqual(checkArrowBackgroundColor) +} + +function checkDigitWithTheme(key: string, localTheme: CustomTheme | undefined, customAttrs: boolean, colorValues: Map | undefined) { + let swiperJson = getInspectorByKey(key) + let indicatorJson: string = JSON.parse(swiperJson)?.$attrs?.indicator?.toString() + let fontColor: string = JSON.parse(indicatorJson)?.fontColor?.toString() + let checkFontColor: string = (customAttrs ? brownCustomTheme : localTheme)?.colors?.fontPrimary?.toString() + ?? colorValues?.get('fontPrimary') + ?? EMPTY_CHECK + expect(fontColor).assertEqual(checkFontColor) + + let selectedFontColor: string = JSON.parse(indicatorJson)?.selectedFontColor?.toString() + let checkSelectedFontColor: string = (customAttrs ? brownCustomTheme : localTheme)?.colors?.fontPrimary?.toString() + ?? colorValues?.get('fontPrimary') + ?? EMPTY_CHECK + expect(selectedFontColor).assertEqual(checkSelectedFontColor) + + let arrowColor: string = JSON.parse(swiperJson)?.$attrs?.arrowColor?.toString() ?? EMPTY_ATTR + let checkArrowColor: string = (customAttrs ? brownCustomTheme : localTheme)?.colors?.iconPrimary?.toString() + ?? colorValues?.get('iconPrimary') + ?? EMPTY_CHECK + expect(arrowColor).assertEqual(checkArrowColor) + + let arrowBackgroundColor: string = JSON.parse(swiperJson)?.$attrs?.arrowBackgroundColor?.toString() ?? EMPTY_ATTR + let checkArrowBackgroundColor: string = (customAttrs ? brownCustomTheme : localTheme)?.colors?.compBackgroundSecondary?.toString() + ?? colorValues?.get('compBackgroundSecondary') + ?? EMPTY_CHECK + expect(arrowBackgroundColor).assertEqual(checkArrowBackgroundColor) +} + +function checkTextWithTheme(key: string, localTheme: CustomTheme | undefined, colorValues: Map | undefined) { + const textJSON = getInspectorByKey(key) + const attrsText = (JSON.parse(textJSON)?.$attrs as TextAttribute) + const fontColor: string = attrsText?.fontColor?.toString() ?? EMPTY_ATTR + expect(fontColor).assertEqual(localTheme?.colors?.fontPrimary + ?? colorValues?.get("fontPrimary") ?? EMPTY_CHECK) } \ No newline at end of file