Skip to content

Commit

Permalink
delay in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tanja04 committed Jul 12, 2024
1 parent 466cfda commit 6e1e296
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 66 deletions.
7 changes: 4 additions & 3 deletions src/SpotifyConnect/SPOCTestApiNext.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Class {

{
#category : #running,
#'squeak_changestamp' : 'TL 7/12/2024 16:18'
#'squeak_changestamp' : 'TL 7/12/2024 16:45'
}
SPOCTestApiNext >> setUp [

Expand All @@ -33,14 +33,15 @@ SPOCTestApiNext >> testApiNextExecute [

{
#category : #testing,
#'squeak_changestamp' : 'TL 6/24/2024 02:08'
#'squeak_changestamp' : 'TL 7/12/2024 16:35'
}
SPOCTestApiNext >> testSkipToNextOn [

| oldPlaybackState newPlaybackState |
oldPlaybackState := self getPlaybackState.
self apiEndpoint skipToNextOn: oldPlaybackState device id.
(Delay forSeconds: 0.6) wait.
newPlaybackState := self getPlaybackState.
"self assert: newPlaybackState track id ~= oldPlaybackState track id."
self assert: newPlaybackState track id ~= oldPlaybackState track id.
self assert: newPlaybackState isPlaying
]
3 changes: 2 additions & 1 deletion src/SpotifyConnect/SPOCTestApiPause.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ SPOCTestApiPause >> testApiPauseExecute [

{
#category : #testing,
#'squeak_changestamp' : 'TL 6/24/2024 01:53'
#'squeak_changestamp' : 'TL 7/12/2024 16:39'
}
SPOCTestApiPause >> testPauseOn [

self apiEndpoint pauseOn: self getPlaybackState device id.
(Delay forSeconds: 0.6) wait.
self assert: self getPlaybackState isPlaying not
]
33 changes: 33 additions & 0 deletions src/SpotifyConnect/SPOCTestApiPlay.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,36 @@ SPOCTestApiPlay >> testApiPlayTrackwithPlaylistExecute [
res := self apiEndpoint execute: dict.
self assert: res response code = 204
]

{
#category : #testing,
#'squeak_changestamp' : 'TL 7/12/2024 16:40'
}
SPOCTestApiPlay >> testPlayTrackOn [

| playbackState |
self apiEndpoint playTrack: '4PTG3Z6ehGkBFwjybzWkR8' on: self getPlaybackState device id.
(Delay forSeconds: 0.6) wait.
playbackState := self getPlaybackState.
self assert: playbackState track id = '4PTG3Z6ehGkBFwjybzWkR8'.
self assert: playbackState isPlaying

]

{
#category : #testing,
#'squeak_changestamp' : 'TL 7/12/2024 16:41'
}
SPOCTestApiPlay >> testPlayTrackWithAlbumOn [

| playbackState |
self apiEndpoint playTrack: '4PTG3Z6ehGkBFwjybzWkR8'
withAlbum: '6eUW0wxWtzkFdaEFsTJto6'
on: self getPlaybackState device id.
(Delay forSeconds: 0.6) wait.
playbackState := self getPlaybackState.
self assert: playbackState track id = '4PTG3Z6ehGkBFwjybzWkR8'.
self assert: playbackState track album id = '6eUW0wxWtzkFdaEFsTJto6'.
self assert: playbackState isPlaying

]
2 changes: 1 addition & 1 deletion src/SpotifyConnect/SPOCTestApiPrevious.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Class {

{
#category : #running,
#'squeak_changestamp' : 'TL 6/24/2024 03:21'
#'squeak_changestamp' : 'TL 7/12/2024 16:45'
}
SPOCTestApiPrevious >> setUp [

Expand Down
3 changes: 2 additions & 1 deletion src/SpotifyConnect/SPOCTestApiSwitchDevice.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@ SPOCTestApiSwitchDevice >> testApiSwitchDeviceExecute [

{
#category : #testing,
#'squeak_changestamp' : 'TL 6/24/2024 02:05'
#'squeak_changestamp' : 'TL 7/12/2024 16:39'
}
SPOCTestApiSwitchDevice >> testSwitchDeviceTo [

| newDeviceID |
newDeviceID := self getPlaybackState device id.
self apiEndpoint switchDeviceTo: newDeviceID.
(Delay forSeconds: 0.6) wait.
self assert: self getPlaybackState device id = newDeviceID
]
60 changes: 0 additions & 60 deletions src/SpotifyConnect/SPOCTestPlay.class.st

This file was deleted.

0 comments on commit 6e1e296

Please sign in to comment.