git.iko.soy/typeable/elm-ui
on master help sign in
add Testable.Border
7719c06Elm UI Automation
tests-rendering/cases/elm.json+20−23
@@ -1,26 +1,23 @@
1{
1{
2− "type": "application",
2+ "type": "application",
3− "source-directories": [
3+ "source-directories": ["open", "../src/"],
4− "open",
5− "../src/"
6− ],
7− "elm-version": "0.19.0",
4+ "elm-version": "0.19.1",
8− "dependencies": {
5+ "dependencies": {
9− "direct": {
6+ "direct": {
10− "elm/browser": "1.0.0",
7+ "elm/browser": "1.0.0",
11− "elm/core": "1.0.0",
8+ "elm/core": "1.0.0",
12− "elm/html": "1.0.0",
9+ "elm/html": "1.0.0",
13− "elm/json": "1.0.0",
10+ "elm/json": "1.0.0",
14− "elm/virtual-dom": "1.0.0",
11+ "elm/virtual-dom": "1.0.0",
15− "ohanhi/lorem": "1.0.2"
12+ "ohanhi/lorem": "1.0.2"
16− },
17− "indirect": {
18− "elm/time": "1.0.0",
19− "elm/url": "1.0.0"
20− }
21 },
13 },
22− "test-dependencies": {
23− "direct": {},
24− "indirect": {}
14+ "indirect": {
15+ "elm/time": "1.0.0",
16+ "elm/url": "1.0.0"
25 }
17 }
18+ },
19+ "test-dependencies": {
20+ "direct": {},
21+ "indirect": {}
22+ }
26−}
23+}
tests-rendering/cases/open/InFrontSize.elmnew file+32
@@ -0,0 +1,32 @@
1+module InFrontSize exposing (main)
2+
3+import Testable.Element exposing (..)
4+import Testable.Element.Background as Background
5+import Testable.Element.Border as Border
6+
7+
8+main =
9+ layout []
10+ (el
11+ [ width (px 100)
12+ , height (px 100)
13+ , centerX
14+ , centerY
15+ , Background.color (rgb 0.1 0.1 0.1)
16+ , Border.width 20
17+ , Border.color (rgb 0.5 1 1)
18+
19+ -- the following element should cover the parent's border
20+ , inFront
21+ (el
22+ [ width fill
23+ , height fill
24+ , Background.color (rgb 0.1 0.5 0.9)
25+
26+ -- , moveUp 40
27+ ]
28+ none
29+ )
30+ ]
31+ none
32+ )
tests-rendering/elm.json+3−3
@@ -7,14 +7,14 @@
7 "elm-version": "0.19.1",
7 "elm-version": "0.19.1",
8 "dependencies": {
8 "dependencies": {
9 "direct": {
9 "direct": {
10− "elm/browser": "1.0.0",
10+ "elm/browser": "1.0.2",
11 "elm/core": "1.0.0",
11 "elm/core": "1.0.0",
12 "elm/html": "1.0.0",
12 "elm/html": "1.0.0",
13 "elm/json": "1.0.0",
13 "elm/json": "1.0.0",
14 "elm/parser": "1.1.0",
14 "elm/parser": "1.1.0",
15 "elm/random": "1.0.0",
15 "elm/random": "1.0.0",
16 "elm/time": "1.0.0",
16 "elm/time": "1.0.0",
17− "elm/virtual-dom": "1.0.0",
17+ "elm/virtual-dom": "1.0.2",
18 "elm-explorations/test": "1.1.0"
18 "elm-explorations/test": "1.1.0"
19 },
19 },
20 "indirect": {
20 "indirect": {
@@ -25,4 +25,4 @@
25 "direct": {},
25 "direct": {},
26 "indirect": {}
26 "indirect": {}
27 }
27 }
28−}
28+}
tests-rendering/make.shnew file+2
@@ -0,0 +1,2 @@
1+
2+elm-live cases/open/InFrontSize.elm --open --dir=view -- --output=view/elm.js --debug
tests-rendering/src/Testable/Element.elm+29
@@ -19,8 +19,11 @@ module Testable.Element exposing
19 , inFront
19 , inFront
20 , isVisible
20 , isVisible
21 , label
21 , label
22+ , layout
22 , maximum
23 , maximum
23 , minimum
24 , minimum
25+ , moveDown
26+ , moveUp
24 , none
27 , none
25 , onLeft
28 , onLeft
26 , onRight
29 , onRight
@@ -28,6 +31,8 @@ module Testable.Element exposing
28 , paddingXY
31 , paddingXY
29 , paragraph
32 , paragraph
30 , px
33 , px
34+ , rgb
35+ , rgba
31 , row
36 , row
32 , shrink
37 , shrink
33 , spacing
38 , spacing
@@ -54,6 +59,14 @@ import Element
54import Expect
59import Expect
55import Html.Attributes
60import Html.Attributes
56import Testable
61import Testable
62+import Testable.Runner
63+
64+
65+layout : List (Testable.Attr msg) -> Testable.Element Testable.Runner.Msg -> Testable.Runner.TestableProgram
66+layout attrs elem =
67+ Testable.Runner.program
68+ [ ( "Open Case", elem )
69+ ]
57
70
58
71
59text : String -> Testable.Element msg
72text : String -> Testable.Element msg
@@ -91,6 +104,14 @@ textColumn =
91 Testable.TextColumn
104 Testable.TextColumn
92
105
93
106
107+moveUp x =
108+ Testable.Attr (Element.moveUp x)
109+
110+
111+moveDown x =
112+ Testable.Attr (Element.moveDown x)
113+
114+
94type Length
115type Length
95 = Px Int
116 = Px Int
96 | Fill Int
117 | Fill Int
@@ -107,6 +128,14 @@ maximum =
107 Maximum
128 Maximum
108
129
109
130
131+rgb =
132+ Element.rgb
133+
134+
135+rgba =
136+ Element.rgba
137+
138+
110px : Int -> Length
139px : Int -> Length
111px =
140px =
112 Px
141 Px
tests-rendering/src/Testable/Element/Border.elmnew file+20
@@ -0,0 +1,20 @@
1+module Testable.Element.Border exposing (..)
2+
3+{-| -}
4+
5+import Dict
6+import Element exposing (Color)
7+import Element.Border as Border
8+import Element.Font as Font
9+import Expect
10+import Testable
11+
12+
13+color : Color -> Testable.Attr msg
14+color clr =
15+ Testable.Attr (Border.color clr)
16+
17+
18+width : Int -> Testable.Attr msg
19+width i =
20+ Testable.Attr (Border.width i)
tests-rendering/src/Testable/Runner.elm+1−1
@@ -1,4 +1,4 @@
1−port module Testable.Runner exposing (TestableProgram, program, show)
1+port module Testable.Runner exposing (Msg, TestableProgram, program, show)
2
2
3{-| -}
3{-| -}
4
4