diff --git a/tests/screenshot/apps/Agate-View.js b/tests/screenshot/apps/Agate-View.js
index fc2f6406c..f325acff2 100644
--- a/tests/screenshot/apps/Agate-View.js
+++ b/tests/screenshot/apps/Agate-View.js
@@ -26,6 +26,13 @@ function getWrapperClasses ({wrapper}) {
return cx('wrapper', wrapper, parsed.skin);
}
+function getWrapperStyle ({wrapper = {}}) {
+ const {padded} = wrapper;
+ if (padded && padded !== true) {
+ return {'--wrapper-padding': padded};
+ }
+}
+
function prepareTest (componentName, testId) {
const ElementProps = {
'data-ui-test-id': 'test',
@@ -64,7 +71,8 @@ function prepareTest (componentName, testId) {
return {
testElement: cloneElement(component, ElementProps, children),
- wrapperClasses: getWrapperClasses(agateComponents[componentName][testId])
+ wrapperClasses: getWrapperClasses(agateComponents[componentName][testId]),
+ wrapperStyle: getWrapperStyle(agateComponents[componentName][testId])
};
}
@@ -83,7 +91,8 @@ function prepareFromUrl () {
}
return {
testElement: ,
- wrapperClasses: getWrapperClasses({skin: parsed.skin, wrapper: wrapperProps})
+ wrapperClasses: getWrapperClasses({skin: parsed.skin, wrapper: wrapperProps}),
+ wrapperStyle: getWrapperStyle({skin: parsed.skin, wrapper: wrapperProps})
};
}
class App extends ReactComponent {
@@ -100,7 +109,7 @@ class App extends ReactComponent {
render () {
const {component, testId, locale, ...props} = this.props;
let testElement;
- let wrapperClasses;
+ let wrapperClasses, wrapperStyle;
if (this.state.hasError) {
return (
@@ -113,14 +122,14 @@ class App extends ReactComponent {
}
if (testId >= 0) {
- ({testElement, wrapperClasses} = prepareTest(component, testId, locale));
+ ({testElement, wrapperClasses, wrapperStyle} = prepareTest(component, testId, locale));
} else {
- ({testElement, wrapperClasses} = prepareFromUrl());
+ ({testElement, wrapperClasses, wrapperStyle} = prepareFromUrl());
}
return (
-
{testElement}
+
{testElement}
);
}
diff --git a/tests/screenshot/apps/Agate-View.less b/tests/screenshot/apps/Agate-View.less
index 8d6a453f7..3d9319c24 100644
--- a/tests/screenshot/apps/Agate-View.less
+++ b/tests/screenshot/apps/Agate-View.less
@@ -15,7 +15,7 @@
background-size: 12px 12px, 12px 12px;
&.padded {
- padding: 140px;
+ padding: var(--wrapper-padding, 140px);
}
&.narrow {
diff --git a/tests/screenshot/apps/components/ArcPicker.js b/tests/screenshot/apps/components/ArcPicker.js
index dd3047413..f7bb74d5a 100644
--- a/tests/screenshot/apps/components/ArcPicker.js
+++ b/tests/screenshot/apps/components/ArcPicker.js
@@ -1,8 +1,20 @@
import ArcPicker from '../../../../ArcPicker';
+import {withConfig} from './utils';
+
const ArcPickerTests = [
{[1, 2, 3, 4]} ,
- {[1, 2, 3, 4]}
+ {[1, 2, 3, 4]} ,
+ {[1, 2, 3, 4]} ,
+ {[1, 2, 3, 4]} ,
+ {[1, 2, 3, 4]} ,
+
+ // Focus
+ ...withConfig({focus: true}, [
+ {[1, 2, 3, 4, 5]} ,
+ {[1, 2, 3, 4, 5]} ,
+ {[1, 2, 3, 4, 5]}
+ ])
];
export default ArcPickerTests;
diff --git a/tests/screenshot/apps/components/ColorPicker.js b/tests/screenshot/apps/components/ColorPicker.js
index c3e44b0a5..8a21fb4d1 100644
--- a/tests/screenshot/apps/components/ColorPicker.js
+++ b/tests/screenshot/apps/components/ColorPicker.js
@@ -3,7 +3,8 @@ import ColorPicker from '../../../../ColorPicker';
const ColorPickerTests = [
{[]} ,
{[]} ,
- {[]}
+ {[]} ,
+ {[]}
];
export default ColorPickerTests;
diff --git a/tests/screenshot/apps/components/ContextualPopupDecorator.js b/tests/screenshot/apps/components/ContextualPopupDecorator.js
index 7076e5bf2..017583584 100644
--- a/tests/screenshot/apps/components/ContextualPopupDecorator.js
+++ b/tests/screenshot/apps/components/ContextualPopupDecorator.js
@@ -1,28 +1,32 @@
import Button from '../../../../Button';
import ContextualPopupDecorator from '../../../../ContextualPopupDecorator';
+import {withConfig} from './utils';
+
const ContextualButton = ContextualPopupDecorator(Button);
const Popup = () => hello
;
+const wrapper = {
+ padded: '240px'
+};
+
const ContextualPopupDecoratorTests = [
- {
- component: Button ,
- wrapper: {
- padded: true
- }
- },
- {
- component: Button ,
- wrapper: {
- padded: true
- }
- },
- {
- component: Button ,
- wrapper: {
- padded: true
- }
- }
+ ...withConfig({wrapper}, [
+ Button ,
+ Button ,
+ Button ,
+ Button ,
+ Button ,
+ Button ,
+ Button ,
+ Button ,
+ Button ,
+ Button ,
+ Button ,
+ Button ,
+ Button ,
+ Button
+ ])
];
export default ContextualPopupDecoratorTests;
diff --git a/tests/screenshot/apps/components/Drawer.js b/tests/screenshot/apps/components/Drawer.js
index b39853c64..028a2aaa4 100644
--- a/tests/screenshot/apps/components/Drawer.js
+++ b/tests/screenshot/apps/components/Drawer.js
@@ -2,7 +2,8 @@ import Drawer from '../../../../Drawer';
const DrawerTests = [
{[]} ,
- {[]}
+ {[]} ,
+ {[]}
];
export default DrawerTests;
diff --git a/tests/screenshot/apps/components/Input.js b/tests/screenshot/apps/components/Input.js
index 5fe3029b7..0031a8bdc 100644
--- a/tests/screenshot/apps/components/Input.js
+++ b/tests/screenshot/apps/components/Input.js
@@ -71,6 +71,20 @@ const InputTests = [
,
,
+ ]),
+
+ // RTL
+ ...withConfig({locale: 'ar-SA'}, [
+ ,
+ ,
+ ,
+ ,
+ ,
+
+
+
,
+ ,
+
])
];
diff --git a/tests/ui/apps/Checkbox/Checkbox-View.js b/tests/ui/apps/Checkbox/Checkbox-View.js
new file mode 100644
index 000000000..07c6d7f3d
--- /dev/null
+++ b/tests/ui/apps/Checkbox/Checkbox-View.js
@@ -0,0 +1,35 @@
+import Checkbox from '../../../../Checkbox';
+import ThemeDecorator from '../../../../ThemeDecorator';
+import spotlight from '@enact/spotlight';
+
+// NOTE: Forcing pointer mode off so we can be sure that regardless of webOS pointer mode the app
+// runs the same way
+spotlight.setPointerMode(false);
+
+const app = (props) =>
+
+
+
+
+
+
+
+
+
+
+
+
+
;
+
+export default ThemeDecorator(app);
diff --git a/tests/ui/specs/Checkbox/Checkbox-specs.js b/tests/ui/specs/Checkbox/Checkbox-specs.js
new file mode 100644
index 000000000..273fe41a2
--- /dev/null
+++ b/tests/ui/specs/Checkbox/Checkbox-specs.js
@@ -0,0 +1,114 @@
+const Page = require('./CheckboxPage');
+
+describe('Checkbox', function () {
+
+ beforeEach(async function () {
+ await Page.open();
+ });
+
+ const {
+ defaultCheckbox,
+ selectedCheckbox,
+ indeterminateCheckbox,
+ disabledCheckbox
+ } = Page.components;
+
+ describe('default', function () {
+ it('should focus on load', async function () {
+ expect(await defaultCheckbox.self.isFocused()).toBe(true);
+ });
+
+ it('should not be checked', async function () {
+ expect(await defaultCheckbox.isChecked).toBe(false);
+ });
+
+ it('should be checked', async function () {
+ expect(await selectedCheckbox.isChecked).toBe(true);
+ });
+ });
+
+ describe('5-way', function () {
+ it('should focus', async function () {
+ await Page.spotlightDown();
+
+ expect(await selectedCheckbox.self.isFocused()).toBe(true);
+
+ await Page.spotlightDown();
+
+ expect(await indeterminateCheckbox.self.isFocused()).toBe(true);
+
+ await Page.spotlightDown();
+
+ expect(await disabledCheckbox.self.isFocused()).toBe(true);
+ });
+
+ it('should get checked', async function () {
+ await Page.spotlightSelect();
+
+ expect(await defaultCheckbox.isChecked).toBe(true);
+ });
+
+ it('should get checked \'indeterminate\'', async function () {
+ await Page.spotlightDown();
+ await Page.spotlightDown();
+ await Page.spotlightSelect();
+
+ expect(await indeterminateCheckbox.isChecked).toBe(true);
+ });
+
+ it('should re-uncheck the item when selected twice', async function () {
+ await Page.spotlightSelect();
+ await Page.spotlightSelect();
+ expect(await defaultCheckbox.isChecked).toBe(false);
+ });
+
+ it('should not get checked', async function () {
+ await Page.spotlightDown();
+ await Page.spotlightDown();
+ await Page.spotlightDown();
+ await Page.spotlightSelect();
+
+ expect(await disabledCheckbox.isChecked).toBe(false);
+ });
+
+ it('should get unchecked', async function () {
+ await Page.spotlightDown();
+ await Page.spotlightSelect();
+
+ expect(await selectedCheckbox.isChecked).toBe(false);
+ });
+ });
+
+ describe('pointer', function () {
+ it('should get checked', async function () {
+ await defaultCheckbox.self.click();
+
+ expect(await defaultCheckbox.isChecked).toBe(true);
+ });
+
+ it('should get checked \'indeterminate\'', async function () {
+ await indeterminateCheckbox.self.click();
+
+ expect(await indeterminateCheckbox.isChecked).toBe(true);
+ });
+
+ it('should re-uncheck the item when selected twice', async function () {
+ await defaultCheckbox.self.click();
+ await defaultCheckbox.self.click();
+
+ expect(await defaultCheckbox.isChecked).toBe(false);
+ });
+
+ it('should not get checked', async function () {
+ await disabledCheckbox.self.click();
+
+ expect(await disabledCheckbox.isChecked).toBe(false);
+ });
+
+ it('should get unchecked', async function () {
+ await selectedCheckbox.self.click();
+
+ expect(await selectedCheckbox.isChecked).toBe(false);
+ });
+ });
+});
diff --git a/tests/ui/specs/Checkbox/CheckboxPage.js b/tests/ui/specs/Checkbox/CheckboxPage.js
new file mode 100644
index 000000000..b7af71848
--- /dev/null
+++ b/tests/ui/specs/Checkbox/CheckboxPage.js
@@ -0,0 +1,40 @@
+'use strict';
+const {Page} = require('@enact/ui-test-utils/utils');
+
+class CheckboxInterface {
+ constructor (id) {
+ this.id = `${id}`;
+ }
+
+ get self () {
+ return $(`#${this.id}`);
+ }
+
+ get isChecked () {
+ return $(`#${this.id}.Checkbox_Checkbox_selected`).isExisting();
+ }
+}
+
+class CheckboxPage extends Page {
+ constructor () {
+ super();
+ this.title = 'Checkbox Test';
+ const defaultCheckbox = new CheckboxInterface('defaultCheckbox');
+ const selectedCheckbox = new CheckboxInterface('selectedCheckbox');
+ const indeterminateCheckbox = new CheckboxInterface('indeterminateCheckbox');
+ const disabledCheckbox = new CheckboxInterface('disabledCheckbox');
+
+ this.components = {
+ defaultCheckbox,
+ selectedCheckbox,
+ indeterminateCheckbox,
+ disabledCheckbox
+ };
+ }
+
+ async open (urlExtra) {
+ await super.open('Checkbox-View', urlExtra);
+ }
+}
+
+module.exports = new CheckboxPage();