capybara-angular-material 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/js/app.js +44 -0
- data/app/partials/list.html +42 -0
- data/lib/capybara/angular/material/rspec.rb +8 -0
- data/spec/features/demos/list_spec.rb +24 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e80882b9770586ab28d94f38cbbab67d99a3220
|
4
|
+
data.tar.gz: d8f36c6d39b9c06d6608f391cbcbb79bf1a5081d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8d50177386851ad42a54309f92a7a1b54cb6066f19048b2b17710608adc463687fb3f5b4e75acab9a97508745566f281c2accb87e8522eef8c2cfefef36c902
|
7
|
+
data.tar.gz: da77502a297142226b73f5438f53eeb6cc6f96d628027dd259ebe522036c82fd17bc2dafcc6d0ac068f2e3375ef2aa6cc1745d769576bc7de823f7345527c75c
|
data/app/js/app.js
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
angular.module('app', ['ngMaterial', 'ngRoute']).config(function($routeProvider) {
|
3
3
|
$routeProvider.when('/button', {templateUrl: 'app/partials/button.html', controller: 'buttonCtrl'});
|
4
4
|
$routeProvider.when('/checkbox', {templateUrl: 'app/partials/checkbox.html', controller: 'checkboxCtrl'});
|
5
|
+
$routeProvider.when('/list', {templateUrl: 'app/partials/list.html', controller: 'listCtrl'});
|
5
6
|
$routeProvider.when('/radio', {templateUrl: 'app/partials/radio.html', controller: 'radioCtrl'});
|
6
7
|
$routeProvider.when('/select', {templateUrl: 'app/partials/select.html', controller: 'selectCtrl'});
|
7
8
|
}).controller('appController', function($scope) {
|
@@ -17,6 +18,49 @@ angular.module('app', ['ngMaterial', 'ngRoute']).config(function($routeProvider)
|
|
17
18
|
$scope.data.cb3 = false;
|
18
19
|
$scope.data.cb4 = false;
|
19
20
|
$scope.data.cb5 = false;
|
21
|
+
}).controller('listCtrl', function($scope) {
|
22
|
+
var imagePath = 'img/list/60.jpeg';
|
23
|
+
$scope.phones = [
|
24
|
+
{ type: 'Home', number: '(555) 251-1234' },
|
25
|
+
{ type: 'Cell', number: '(555) 786-9841' },
|
26
|
+
];
|
27
|
+
$scope.todos = [
|
28
|
+
{
|
29
|
+
face : imagePath,
|
30
|
+
what: 'Brunch this weekend?',
|
31
|
+
who: 'Min Li Chan',
|
32
|
+
when: '3:08PM',
|
33
|
+
notes: " I'll be in your neighborhood doing errands"
|
34
|
+
},
|
35
|
+
{
|
36
|
+
face : imagePath,
|
37
|
+
what: 'Brunch this weekend?',
|
38
|
+
who: 'Min Li Chan',
|
39
|
+
when: '3:08PM',
|
40
|
+
notes: " I'll be in your neighborhood doing errands"
|
41
|
+
},
|
42
|
+
{
|
43
|
+
face : imagePath,
|
44
|
+
what: 'Brunch this weekend?',
|
45
|
+
who: 'Min Li Chan',
|
46
|
+
when: '3:08PM',
|
47
|
+
notes: " I'll be in your neighborhood doing errands"
|
48
|
+
},
|
49
|
+
{
|
50
|
+
face : imagePath,
|
51
|
+
what: 'Brunch this weekend?',
|
52
|
+
who: 'Min Li Chan',
|
53
|
+
when: '3:08PM',
|
54
|
+
notes: " I'll be in your neighborhood doing errands"
|
55
|
+
},
|
56
|
+
{
|
57
|
+
face : imagePath,
|
58
|
+
what: 'Brunch this weekend?',
|
59
|
+
who: 'Min Li Chan',
|
60
|
+
when: '3:08PM',
|
61
|
+
notes: " I'll be in your neighborhood doing errands"
|
62
|
+
},
|
63
|
+
];
|
20
64
|
}).controller('radioCtrl', function($scope) {
|
21
65
|
$scope.data = {
|
22
66
|
group1 : 'Banana',
|
@@ -0,0 +1,42 @@
|
|
1
|
+
<div ng-controller="listCtrl">
|
2
|
+
<md-content>
|
3
|
+
<md-list>
|
4
|
+
<md-subheader class="md-no-sticky">3 line item</md-subheader>
|
5
|
+
<md-list-item class="md-3-line" ng-repeat="item in todos">
|
6
|
+
<img ng-src="{{item.face}}?{{$index}}" class="md-avatar" alt="{{item.who}}" />
|
7
|
+
<div class="md-list-item-text" layout="column">
|
8
|
+
<h3>{{ item.who }}</h3>
|
9
|
+
<h4>{{ item.what }}</h4>
|
10
|
+
<p>{{ item.notes }}</p>
|
11
|
+
</div>
|
12
|
+
</md-list-item>
|
13
|
+
<md-divider ></md-divider>
|
14
|
+
<md-subheader class="md-no-sticky">2 line item</md-subheader>
|
15
|
+
<md-list-item class="md-2-line">
|
16
|
+
<img ng-src="{{todos[0].face}}?20" class="md-avatar" alt="{{todos[0].who}}" />
|
17
|
+
<div class="md-list-item-text">
|
18
|
+
<h3>{{ todos[0].who }}</h3>
|
19
|
+
<p>Secondary text</p>
|
20
|
+
</div>
|
21
|
+
</md-list-item>
|
22
|
+
<md-divider ></md-divider>
|
23
|
+
<md-subheader class="md-no-sticky">3 line item, long paragraph (see on mobile)</md-subheader>
|
24
|
+
<md-list-item class="md-3-line">
|
25
|
+
<img ng-src="{{todos[0].face}}?25" class="md-avatar" alt="{{todos[0].who}}" />
|
26
|
+
<div class="md-list-item-text">
|
27
|
+
<h3>{{ todos[0].who }}</h3>
|
28
|
+
<p>Secondary line text Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam massa quam.</p>
|
29
|
+
</div>
|
30
|
+
</md-list-item>
|
31
|
+
<md-divider ></md-divider>
|
32
|
+
<md-subheader class="md-no-sticky">md-offset class</md-subheader>
|
33
|
+
<md-list-item class="md-2-line" ng-repeat="phone in phones">
|
34
|
+
<md-icon md-svg-icon="communication:phone" ng-if="$index === 0"></md-icon>
|
35
|
+
<div class="md-list-item-text" ng-class="{'md-offset': $index != 0 }">
|
36
|
+
<h3> {{ phone.number }} </h3>
|
37
|
+
<p> {{ phone.type }} </p>
|
38
|
+
</div>
|
39
|
+
</md-list-item>
|
40
|
+
</md-list>
|
41
|
+
</md-content>
|
42
|
+
</div>
|
@@ -10,6 +10,14 @@ module Capybara
|
|
10
10
|
HaveSelector.new(:xpath, "//md-checkbox#{aria_checked(options)}#{ng_disabled(options)}/*/span[normalize-space(text())='#{locator}']")
|
11
11
|
end
|
12
12
|
|
13
|
+
def have_md_list
|
14
|
+
HaveSelector.new(:xpath, '//md-list')
|
15
|
+
end
|
16
|
+
|
17
|
+
def have_md_list_item(locator)
|
18
|
+
HaveSelector.new(:xpath, "//md-list-item[.//*[contains(text(), '#{locator}')]]")
|
19
|
+
end
|
20
|
+
|
13
21
|
def have_md_radio_button(locator, options={})
|
14
22
|
HaveSelector.new(:xpath, "//md-radio-button#{aria_checked(options)}/*/span[normalize-space(text())='#{locator}']")
|
15
23
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
feature 'Angular Material Demos - lists' do
|
2
|
+
before do
|
3
|
+
visit('/index.html#/list')
|
4
|
+
expect(page.find('h1')).to have_content 'Capybara Angular Material'
|
5
|
+
end
|
6
|
+
|
7
|
+
it 'has a list' do
|
8
|
+
expect(page).to have_md_list()
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'has no list' do
|
12
|
+
expect('md-list is not here').not_to have_md_list()
|
13
|
+
end
|
14
|
+
|
15
|
+
feature 'List items' do
|
16
|
+
it 'has a list item that contains text' do
|
17
|
+
expect(page).to have_md_list_item('Min Li')
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'has no list item' do
|
21
|
+
expect(page).not_to have_md_list_item('There is no list item with this in it')
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capybara-angular-material
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rimian Perkins
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|
@@ -106,6 +106,7 @@ files:
|
|
106
106
|
- app/js/app.js
|
107
107
|
- app/partials/button.html
|
108
108
|
- app/partials/checkbox.html
|
109
|
+
- app/partials/list.html
|
109
110
|
- app/partials/radio.html
|
110
111
|
- app/partials/select.html
|
111
112
|
- capybara-angular-material.gemspec
|
@@ -117,6 +118,7 @@ files:
|
|
117
118
|
- package.json
|
118
119
|
- spec/features/demos/button_spec.rb
|
119
120
|
- spec/features/demos/checkbox_spec.rb
|
121
|
+
- spec/features/demos/list_spec.rb
|
120
122
|
- spec/features/demos/radio_spec.rb
|
121
123
|
- spec/features/demos/select_spec.rb
|
122
124
|
- spec/spec_helper.rb
|