
Recherche avancée
Autres articles (58)
-
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
Submit bugs and patches
13 avril 2011Unfortunately a software is never perfect.
If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
You may also (...) -
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)
Sur d’autres sites (4357)
-
How to write UI tests for your plugin – Introducing the Piwik Platform
18 février 2015, par Thomas Steur — DevelopmentThis is the next post of our blog series where we introduce the capabilities of the Piwik platform (our previous post was How to write unit tests for your plugin). This time you’ll learn how to write UI tests in Piwik. For this tutorial you will need to have basic knowledge of JavaScript and the Piwik platform.
What is a UI test ?
Some might know a UI test under the term ‘CSS test’ or ‘screenshot test’. When we speak of UI tests we mean automated tests that capture a screenshot of a URL and then compare the result with an expected image. If the images are not exactly the same the test will fail. For more information read our blog post about UI Testing.
What is a UI test good for ?
We use them to test our PHP Controllers, Twig templates, CSS, and indirectly test our JavaScript. We do usually not write Unit or Integration tests for our controllers. For example we use UI tests to ensure that the installation, the login and the update process works as expected. We also have tests for most pages, reports, settings, etc. This increases the quality of our product and saves us a lot of time as it is easy to write and maintain such tests. All UI tests are executed on Travis after each commit and compared with our expected screenshots.
Getting started
In this post, we assume that you have already installed Piwik 2.11.0 or later via git, set up your development environment and created a plugin. If not, visit the Piwik Developer Zone where you’ll find the tutorial Setting up Piwik and other Guides that help you to develop a plugin.
Next you need to install the needed packages to execute UI tests.
Let’s create a UI test
We start by using the Piwik Console to create a new UI test :
./console generate:test --testtype ui
The command will ask you to enter the name of the plugin the created test should belong to. I will use the plugin name “Widgetize”. Next it will ask you for the name of the test. Here you usually enter the name of the page or report you want to test. I will use the name “WidgetizePage” in this example. There should now be a file
plugins/Widgetize/tests/UI/WidgetizePage_spec.js
which contains already an example to get you started easily :describe("WidgetizePage", function () {
var generalParams = 'idSite=1&period=day&date=2010-01-03';
it('should load a simple page by its module and action', function (done) {
var screenshotName = 'simplePage';
// will save image in "processed-ui-screenshots/WidgetizePageTest_simplePage.png"
expect.screenshot(screenshotName).to.be.capture(function (page) {
var urlToTest = "?" + generalParams + "&module=Widgetize&action=index";
page.load(urlToTest);
}, done);
});
});What is happening here ?
This example declares a new set of specs by calling the method
describe(name, callback)
and within that a new spec by calling the methodit(description, func)
. Within the spec we load a URL and once loaded capture a screenshot of the whole page. The captured screenshot will be saved under the definedscreenshotName
. You might have noticed we write our UI tests in BDD style.Capturing only a part of the page
It is good practice to not always capture the full page. For example many pages contain a menu and if you change that menu, all your screenshot tests would fail. To avoid this you would instead have a separate test for your menu. To capture only a part of the page simply specify a jQuery selector and call the method
captureSelector
instead ofcapture
:var contentSelector = '#selector1, .selector2 .selector3';
// Only the content of both selectors will be in visible in the captured screenshot
expect.screenshot('page_partial').to.be.captureSelector(contentSelector, function (page) {
page.load(urlToTest);
}, done);Hiding content
There is a known issue with sparklines that can fail tests randomly. Also version numbers or a date that changes from time to time can fail tests without actually having an error. To avoid this you can prevent elements from being visible in the captured screenshot via CSS as we add a CSS class called
uiTest
to theHTML
element while tests are running..uiTest .version { visibility:hidden }
Running a test
To run the previously generated tests we will use the command
tests:run-ui
:./console tests:run-ui WidgetizePage
After running the tests for the first time you will notice a new folder
plugins/PLUGINNAME/tests/UI/processed-ui-screenshots
in your plugin. If everything worked, there will be an image for every captured screenshot. If you’re happy with the result it is time to copy the file over to theexpected-ui-screenshots
folder, otherwise you have to adjust your test until you get the result you want. From now on, the newly captured screenshots will be compared with the expected images whenever you execute the tests.Fixing a test
At some point your UI test will fail, for example due to expected CSS changes. To fix a test all you have to do is to copy the captured screenshot from the folder
processed-ui-screenshots
to the folderexpected-ui-screenshots
.Executing the UI tests on Travis
In case you have not generated a
.travis.yml
file for your plugin yet you can do this by executing the following command :./console generate:travis-yml --plugin PLUGINNAME
Next you have to activate Travis for your repository.
Advanced features
Isn’t it easy to create a UI test ? We never even created a file ! Of course you can accomplish even more if you want. For example you can specify a fixture to be inserted before running the tests which is useful when your plugin requires custom data. You can also control the browser as it was a human by clicking, moving the mouse, typing text, etc. If you want to discover more features have a look at our existing test cases.
If you have any feedback regarding our APIs or our guides in the Developer Zone feel free to send it to us.
-
ffmpeg : merge two video gives error
7 février 2015, par gderacoCommand is :
./ffmpeg -i /sdcard/video.mp4 -i /sdcard/video-zoom.mp4 -strict -2 -threads 5 -preset ultrafast -filter_complex [0:0][0:1][1:0][1:1]concat=n=2:v=1:a=1[v][a] -map ’[v]’ -map ’[a]’ /sdcard/video-final.mp4
Output is : WARNING : linker : ./ffmpeg has text relocations. This is
wasting memory and is a security risk. Please fix. ffmpeg version
n2.4.2 Copyright (c) 2000-2014 the FFmpeg developers built on Oct 7
2014 15:08:46 with gcc 4.8 (GCC) configuration : —target-os=linux
—cross-prefix=/home/sb/Source-Code/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi-
—arch=arm —cpu=cortex-a8 —enable-runtime-cpudetect —sysroot=/home/sb/Source-Code/ffmpeg-android/toolchain-android/sysroot —enable-pic —enable-libx264 —enable-libass —enable-libfreetype —enable-libfribidi —enable-fontconfig —enable-pthreads —disable-debug —disable-ffserver —enable-version3 —enable-hardcoded-tables —disable-ffplay —disable-ffprobe —enable-gpl —enable-yasm —disable-doc —disable-shared —enable-static —pkg-config=/home/sb/Source-Code/ffmpeg-android/ffmpeg-pkg-config —prefix=/home/sb/Source-Code/ffmpeg-android/build/armeabi-v7a-neon —extra-cflags=’-I/home/sb/Source-Code/ffmpeg-android/toolchain-android/include
-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all -mfpu=neon’ —extra-ldflags=’-L/home/sb/Source-Code/ffmpeg-android/toolchain-android/lib
-Wl,-z,relro -Wl,-z,now -pie’ —extra-libs=’-lpng -lexpat -lm’ —extra-cxxflags= libavutil 54. 7.100 / 54. 7.100 libavcodec 56. 1.100 / 56. 1.100 libavformat 56. 4.101 /
56. 4.101 libavdevice 56. 0.100 / 56. 0.100 libavfilter 5. 1.100 / 5. 1.100 libswscale 3. 0.100 / 3. 0.100 libswresample 1. 1.100 / 1. 1.100 libpostproc 53. 0.100 /
53. 0.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from ’/sdcard/video.mp4’ : Metadata :
major_brand : mp42
minor_version : 0
compatible_brands : mp42isomavc1
creation_time : 2010-03-20 21:29:11
encoder : HandBrake 0.9.4 2009112300 Duration : 00:00:05.57, start : 0.000000, bitrate : 551 kb/s
Stream #0:0(und) : Video : h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(tv, bt709), 560x320, 465 kb/s, 30 fps, 30 tbr,
90k tbn, 60 tbc (default)
Metadata :
creation_time : 2010-03-20 21:29:11
encoder : JVT/AVC Coding
Stream #0:1(eng) : Audio : aac (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 83 kb/s (default)
Metadata :
creation_time : 2010-03-20 21:29:11 Input #1, mov,mp4,m4a,3gp,3g2,mj2, from ’/sdcard/video-zoom.mp4’ : Metadata :
major_brand : isom
minor_version : 512
compatible_brands : isomiso2avc1mp41
encoder : Lavf56.4.101 Duration : 00:00:05.00, start : 0.000000, bitrate : 1901 kb/s
Stream #1:0(und) : Video : h264 (Constrained Baseline) (avc1 / 0x31637661), yuvj420p(pc), 1280x720, 1899 kb/s, 25 fps, 25 tbr, 12800
tbn, 50 tbc (default)
Metadata :
handler_name : VideoHandlerStream specifier ’:1’ in filtergraph description
[0:0][0:1][1:0][1:1]concat=n=2:v=1:a=1[v][a] matches no streams. -
Andoid NDK , FFMpeg : Unrecognised option filter_complex
27 février 2015, par Gaganpreet SinghI am creating watermark application using ffmpeg in android.
I used following commandffmpeg -i /storage/emulated/0/WhatsApp/Media/WhatsApp Video/VID-20150217-WA0002.mp4 -i /storage/emulated/0/mp4parser/img001.png -filter_complex '[0:v][1:v]overlay[out]' -map '[out]' /storage/emulated/0/WhatsApp/Media/WhatsApp Video/trimmed-038-VID-20150217-WA0002.mp4
When I launched app I get This line in log :
Unrecognized option 'filter_complex'
I have read this command on FFmpeg.org site, but don’t know why it is not working. I am mentioning log below.Please Help
02-27 16:14:55.881: E/VideoTrimmer(13315): Starting to watermark
02-27 16:14:55.881: E/VideoTrimmer(13315): ffmpeg
02-27 16:14:55.881: E/VideoTrimmer(13315): -i
02-27 16:14:55.881: E/VideoTrimmer(13315): /storage/emulated/0/WhatsApp/Media/WhatsApp Video/VID-20150217-WA0002.mp4
02-27 16:14:55.881: E/VideoTrimmer(13315): -i
02-27 16:14:55.882: E/VideoTrimmer(13315): /storage/emulated/0/mp4parser/img001.png
02-27 16:14:55.882: E/VideoTrimmer(13315): -filter_complex
02-27 16:14:55.882: E/VideoTrimmer(13315): '[0:v][1:v]overlay[out]'
02-27 16:14:55.882: E/VideoTrimmer(13315): -map
02-27 16:14:55.882: E/VideoTrimmer(13315): '[out]'
02-27 16:14:55.883: E/VideoTrimmer(13315): /storage/emulated/0/WhatsApp/Media/WhatsApp Video/trimmed-038-VID-20150217-WA0002.mp4
02-27 16:14:55.883: E/VideoTrimmer(13315): Printed all
02-27 16:14:55.944: E/TakePics(13315): FFmpeg version 0.6.1, Copyright (c) 2000-2010 the FFmpeg developers
02-27 16:14:55.944: E/TakePics(13315): built on Feb 27 2015 16:12:28 with gcc 4.8
02-27 16:14:55.944: E/TakePics(13315): configuration: --target-os=linux --arch=arm --enable-version3 --enable-gpl --enable-nonfree --disable-stripping --disable-ffmpeg --disable-ffplay --disable-ffserver --disable-ffprobe --disable-devices --disable-protocols --enable-protocol=file --enable-avfilter --disable-network --disable-mpegaudio-hp --disable-avdevice --enable-cross-compile --cc=/home/uday/mount/android-ndk-r4b/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/arm-eabi-gcc --cross-prefix=/home/uday/mount/android-ndk-r4b/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/arm-eabi- --nm=/home/uday/mount/android-ndk-r4b/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/arm-eabi-nm --extra-cflags='-fPIC -DANDROID' --disable-asm --enable-neon --enable-armv5te --extra-ldflags='-Wl,-T,/home/uday/mount/android-ndk-r4b/build/prebuilt/linux-x86/arm-eabi-4.4.0/arm-eabi/lib/ldscripts/armelf.x -Wl,-rpath-link=/home/uday/mount/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/lib -L/home/uday/mount/android-ndk-r4b/build/platforms/android-8/arch-arm/usr/lib -nostdli
02-27 16:14:56.152: E/TakePics(13315): Unrecognized option 'filter_complex'I have also tried using filter:v.