Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
119 lines
2.8 KiB
JavaScript
Executable file
119 lines
2.8 KiB
JavaScript
Executable file
/* global require, marionette, setup, test */
|
|
'use strict';
|
|
|
|
var assert = require('assert');
|
|
var Music = require('./lib/music.js');
|
|
|
|
|
|
marionette('Music views', function() {
|
|
var client = marionette.client({
|
|
profile: {
|
|
prefs: {
|
|
'device.storage.enabled': true,
|
|
'device.storage.testing': true,
|
|
'device.storage.prompt.testing': true
|
|
},
|
|
}
|
|
});
|
|
|
|
var music;
|
|
|
|
setup(function() {
|
|
music = new Music(client);
|
|
client.fileManager.removeAllFiles();
|
|
client.fileManager.add([
|
|
{
|
|
type: 'music',
|
|
filePath: 'apps/music/test-data/playlists/01.ogg'
|
|
},
|
|
{
|
|
type: 'music',
|
|
filePath: 'apps/music/test-data/playlists/02.ogg'
|
|
},
|
|
{
|
|
type: 'music',
|
|
filePath: 'apps/music/test-data/playlists/03.ogg'
|
|
},
|
|
{
|
|
type: 'music',
|
|
filePath: 'apps/music/test-data/playlists/a.ogg'
|
|
},
|
|
{
|
|
type: 'music',
|
|
filePath: 'apps/music/test-data/playlists/b.ogg'
|
|
},
|
|
{
|
|
type: 'music',
|
|
filePath: 'apps/music/test-data/playlists/c.ogg'
|
|
},
|
|
{
|
|
type: 'music',
|
|
filePath: 'apps/music/test-data/playlists/w.ogg'
|
|
},
|
|
{
|
|
type: 'music',
|
|
filePath: 'apps/music/test-data/playlists/x.ogg'
|
|
},
|
|
{
|
|
type: 'music',
|
|
filePath: 'apps/music/test-data/playlists/y.ogg'
|
|
},
|
|
]);
|
|
|
|
music.launch();
|
|
music.waitForFirstTile();
|
|
});
|
|
|
|
|
|
test('Check tile view', function() {
|
|
client.switchToFrame(music.homeViewFrame);
|
|
var tile = client.findElement(Music.Selector.firstTile);
|
|
assert.ok(tile);
|
|
tile.tap();
|
|
music.switchToMe();
|
|
|
|
music.waitForPlayerView();
|
|
});
|
|
|
|
|
|
// ported from GiP test_music_album_mp3.py
|
|
test('Check album view. moztrap:3755', function() {
|
|
music.switchToAlbumsView();
|
|
|
|
music.waitForListEnumerate(Music.Selector.activeViewFrame);
|
|
var list = music.albumsListItemsData;
|
|
|
|
var album = list[0].title;
|
|
assert.equal(album, 'We crash computers');
|
|
music.selectAlbum(album);
|
|
music.playFirstSongByAlbum();
|
|
music.waitForPlayerView();
|
|
});
|
|
|
|
// ported from GiP test_music_artist_mp3.py
|
|
test('Check artist view. moztrap:4031', function() {
|
|
music.switchToArtistsView();
|
|
|
|
music.waitForListEnumerate(Music.Selector.activeViewFrame);
|
|
var list = music.artistsListItemsData;
|
|
|
|
var artist = list[0].title;
|
|
assert.equal(artist, 'The Angry Programmers');
|
|
music.selectArtist(artist);
|
|
music.playFirstSongByArtist();
|
|
music.waitForPlayerView();
|
|
});
|
|
|
|
// ported from GiP test_music_songs_mp3.py
|
|
test('Check songs view. moztrap:4031', function() {
|
|
music.switchToSongsView();
|
|
|
|
music.waitForListEnumerate(Music.Selector.activeViewFrame);
|
|
var list = music.songsListItemsData;
|
|
|
|
assert.equal(list[0].title, 'Abort');
|
|
music.playFirstSong();
|
|
music.waitForPlayerView();
|
|
});
|
|
|
|
});
|