2014-02-13 14:56:52 -04:00
@ProcessMakerMichelangelo @RestAPI
Feature : Files Manager Resources
Background :
Given t h a t I h a v e a v a l i d a c c e s s _ t o k e n
Scenario : Get a list of main process files manager
2014-02-20 12:27:28 -04:00
Given I r e q u e s t " p r o j e c t / 1 2 6 5 5 5 7 0 9 5 2 2 5 f f 5 c 6 8 8 f 4 6 0 3 1 7 0 0 4 7 1 / f i l e - m a n a g e r "
2014-02-13 14:56:52 -04:00
Then t h e r e s p o n s e s t a t u s c o d e s h o u l d b e 200
And t h e r e s p o n s e c h a r s e t i s " U T F - 8 "
And t h e c o n t e n t t y p e i s " a p p l i c a t i o n / j s o n "
And t h e t y p e i s " a r r a y "
Scenario : Get a list public folder of process files manager
2014-02-20 12:27:28 -04:00
Given I r e q u e s t " p r o j e c t / 1 2 6 5 5 5 7 0 9 5 2 2 5 f f 5 c 6 8 8 f 4 6 0 3 1 7 0 0 4 7 1 / f i l e - m a n a g e r ? p a t h = p u b l i c "
2014-02-13 14:56:52 -04:00
Then t h e r e s p o n s e s t a t u s c o d e s h o u l d b e 200
And t h e r e s p o n s e c h a r s e t i s " U T F - 8 "
And t h e c o n t e n t t y p e i s " a p p l i c a t i o n / j s o n "
And t h e t y p e i s " a r r a y "
Scenario : Get a list templates folder of process files manager
2014-02-20 12:27:28 -04:00
Given I r e q u e s t " p r o j e c t / 1 2 6 5 5 5 7 0 9 5 2 2 5 f f 5 c 6 8 8 f 4 6 0 3 1 7 0 0 4 7 1 / f i l e - m a n a g e r ? p a t h = t e m p l a t e s "
2014-02-13 14:56:52 -04:00
Then t h e r e s p o n s e s t a t u s c o d e s h o u l d b e 200
And t h e r e s p o n s e c h a r s e t i s " U T F - 8 "
And t h e c o n t e n t t y p e i s " a p p l i c a t i o n / j s o n "
And t h e t y p e i s " a r r a y "
Scenario Outline : Post files
Given P O S T t h i s d a t a :
"""
{
2014-02-20 13:01:30 -04:00
" p r f _ f i l e n a m e " : " <file_name> " ,
" p r f _ p a t h " : " <path> " ,
" p r f _ c o n t e n t " : " <content> "
2014-02-13 14:56:52 -04:00
}
"""
2014-02-20 12:27:28 -04:00
And I r e q u e s t " p r o j e c t / 1 2 6 5 5 5 7 0 9 5 2 2 5 f f 5 c 6 8 8 f 4 6 0 3 1 7 0 0 4 7 1 / f i l e - m a n a g e r "
2014-02-21 09:00:17 -04:00
Then t h e r e s p o n s e s t a t u s c o d e s h o u l d b e <http_code>
2014-02-13 14:56:52 -04:00
And t h e r e s p o n s e c h a r s e t i s " U T F - 8 "
And t h e c o n t e n t t y p e i s " a p p l i c a t i o n / j s o n "
And t h e t y p e i s " <type> "
And s t o r e " p r f _ u i d " i n s e s s i o n a r r a y a s v a r i a b l e " p r f _ u i d <i> "
Examples :
2014-02-21 09:00:17 -04:00
| t e s t _ d e s c r i p t i o n | f i l e _ n a m e | p a t h | c o n t e n t | h t t p _ c o d e | t y p e |
| i n t o p u b l i c f o l d e r | t e s t b e h a t . t x t | p u b l i c / | t e s t | 2 0 0 | o b j e c t |
| i n t o m a i n t e m p l a t e s f o l d e r | t e s t b e h a t . t x t | t e m p l a t e s / | t e s t | 2 0 0 | o b j e c t |
| i n t o p u b l i c s u b f o l d e r | t e s t b e h a t . t x t | p u b l i c / t e s t _ f o l d e r | t e s t | 2 0 0 | o b j e c t |
| i n t o p u b l i c s u b f o l d e r | t e s t b e h a t . t x t | t e m p l a t e s / t e s t _ f o l d e r | t e s t | 2 0 0 | o b j e c t |
2014-02-13 14:56:52 -04:00
Scenario Outline : Post files
Given P U T t h i s d a t a :
"""
{
2014-02-20 13:01:30 -04:00
" p r f _ f i l e n a m e " : " <file_name> " ,
" p r f _ c o n t e n t " : " <content> "
2014-02-13 14:56:52 -04:00
}
"""
2014-02-20 12:27:28 -04:00
And I r e q u e s t " p r o j e c t / 1 2 6 5 5 5 7 0 9 5 2 2 5 f f 5 c 6 8 8 f 4 6 0 3 1 7 0 0 4 7 1 / f i l e - m a n a g e r ? p a t h = <path> "
2014-02-21 09:00:17 -04:00
Then t h e r e s p o n s e s t a t u s c o d e s h o u l d b e <http_code>
2014-02-13 14:56:52 -04:00
And t h e r e s p o n s e c h a r s e t i s " U T F - 8 "
And t h e c o n t e n t t y p e i s " a p p l i c a t i o n / j s o n "
And t h e t y p e i s " <type> "
Examples :
| t e s t _ d e s c r i p t i o n | f i l e _ n a m e | p a t h | c o n t e n t | h t t p _ c o d e | t y p e |
2014-02-20 13:01:30 -04:00
| p u t i n t o p u b l i c f o l d e r | t e s t b e h a t . t x t | p u b l i c / | p u t t e s t | 2 0 0 | o b j e c t |
| p u t i n t o m a i n t e m p l a t e s f o l d e r | t e s t b e h a t . t x t | t e m p l a t e s / | p u t t e s t | 2 0 0 | o b j e c t |
| p u t i n t o p u b l i c s u b f o l d e r | t e s t b e h a t . t x t | p u b l i c / t e s t _ f o l d e r | p u t t e s t | 2 0 0 | o b j e c t |
| p u t i n t o p u b l i c s u b f o l d e r | t e s t b e h a t . t x t | t e m p l a t e s / t e s t _ f o l d e r | p u t t e s t | 2 0 0 | o b j e c t |
2014-02-13 14:56:52 -04:00
2014-02-21 09:00:17 -04:00
2014-02-20 13:01:30 -04:00
Scenario Outline : Delete file
2014-02-13 14:56:52 -04:00
Given t h a t I w a n t t o d e l e t e a " <path> "
2014-02-20 12:27:28 -04:00
And I r e q u e s t " p r o j e c t / 1 2 6 5 5 5 7 0 9 5 2 2 5 f f 5 c 6 8 8 f 4 6 0 3 1 7 0 0 4 7 1 / f i l e - m a n a g e r ? p a t h = <path> "
2014-02-13 14:56:52 -04:00
And t h e c o n t e n t t y p e i s " a p p l i c a t i o n / j s o n "
Then t h e r e s p o n s e s t a t u s c o d e s h o u l d b e 200
And t h e r e s p o n s e c h a r s e t i s " U T F - 8 "
Examples :
2014-02-20 13:01:30 -04:00
| t e s t _ d e s c r i p t i o n | p a t h |
| d e l e t e p u b l i c f o l d e r | p u b l i c / t e s t b e h a t . t x t |
| d e l e t e m a i n t e m p l a t e s f o l d e r | t e m p l a t e s / t e s t b e h a t . t x t |
| d e l e t e p u b l i c s u b f o l d e r | p u b l i c / t e s t _ f o l d e r / t e s t b e h a t . t x t |
2014-02-21 09:00:17 -04:00
| d e l e t e p u b l i c s u b f o l d e r | t e m p l a t e s / t e s t _ f o l d e r / t e s t b e h a t . t x t |
#Para que funcione este test, debe existir el archivo que se quiere subir
Scenario : Post files
2014-02-21 16:31:52 -04:00
Given P O S T I w a n t t o u p l o a d t h e f i l e " / h o m e / d a n i e l / t e s t . t x t " t o p a t h " p u b l i c " . U r l t o c r e a t e p r f _ u i d " p r o j e c t / 1 2 6 5 5 5 7 0 9 5 2 2 5 f f 5 c 6 8 8 f 4 6 0 3 1 7 0 0 4 7 1 / f i l e - m a n a g e r " a n d u p d l o a d " p r o j e c t / 1 2 6 5 5 5 7 0 9 5 2 2 5 f f 5 c 6 8 8 f 4 6 0 3 1 7 0 0 4 7 1 / f i l e - m a n a g e r / u p l o a d "
2014-02-21 09:00:17 -04:00
Scenario : Delete file
Given t h a t I w a n t t o d e l e t e a " p u b l i c / t e s t . t x t "
And I r e q u e s t " p r o j e c t / 1 2 6 5 5 5 7 0 9 5 2 2 5 f f 5 c 6 8 8 f 4 6 0 3 1 7 0 0 4 7 1 / f i l e - m a n a g e r ? p a t h = p u b l i c / t e s t . t x t "
And t h e c o n t e n t t y p e i s " a p p l i c a t i o n / j s o n "
Then t h e r e s p o n s e s t a t u s c o d e s h o u l d b e 200
And t h e r e s p o n s e c h a r s e t i s " U T F - 8 "