-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #671 from ONLYOFFICE/feature/update-translation-tests
Feature/update translation tests
- Loading branch information
Showing
220 changed files
with
1,048 additions
and
229 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
@echo off | ||
|
||
PUSHD %~dp0 | ||
call runasadmin.bat "%~dpnx0" | ||
|
||
if %errorlevel% == 0 ( | ||
PUSHD %~dp0.. | ||
|
||
|
||
echo "mode=" | ||
|
||
|
||
REM call yarn wipe | ||
call yarn install | ||
|
||
call yarn build:test.translation:personal | ||
|
||
REM call yarn wipe | ||
call yarn deploy:personal | ||
|
||
|
||
|
||
REM copy nginx configurations to deploy folder | ||
xcopy config\nginx\onlyoffice.conf build\deploy\nginx\ /E /R /Y | ||
powershell -Command "(gc build\deploy\nginx\onlyoffice.conf) -replace '#', '' | Out-File -encoding ASCII build\deploy\nginx\onlyoffice.conf" | ||
|
||
xcopy config\nginx\sites-enabled\* build\deploy\nginx\sites-enabled\ /E /R /Y | ||
|
||
REM fix paths | ||
powershell -Command "(gc build\deploy\nginx\sites-enabled\onlyoffice-editor.conf) -replace 'ROOTPATH', '%~dp0deploy\products\ASC.Files\editor' -replace '\\', '/' | Out-File -encoding ASCII build\deploy\nginx\sites-enabled\onlyoffice-editor.conf" | ||
powershell -Command "(gc build\deploy\nginx\sites-enabled\onlyoffice-files.conf) -replace 'ROOTPATH', '%~dp0deploy\products\ASC.Files\client' -replace '\\', '/' | Out-File -encoding ASCII build\deploy\nginx\sites-enabled\onlyoffice-files.conf" | ||
powershell -Command "(gc build\deploy\nginx\sites-enabled\onlyoffice-login.conf) -replace 'ROOTPATH', '%~dp0deploy\studio\login' -replace '\\', '/' | Out-File -encoding ASCII build\deploy\nginx\sites-enabled\onlyoffice-login.conf" | ||
powershell -Command "(gc build\deploy\nginx\sites-enabled\onlyoffice-people.conf) -replace 'ROOTPATH', '%~dp0deploy\products\ASC.People\client' -replace '\\', '/' | Out-File -encoding ASCII build\deploy\nginx\sites-enabled\onlyoffice-people.conf" | ||
powershell -Command "(gc build\deploy\nginx\sites-enabled\onlyoffice-studio.conf) -replace 'ROOTPATH', '%~dp0deploy\studio\client' -replace '\\', '/' | Out-File -encoding ASCII build\deploy\nginx\sites-enabled\onlyoffice-studio.conf" | ||
|
||
REM restart nginx | ||
echo service nginx stop | ||
call sc stop nginx > nul | ||
|
||
REM sleep 5 seconds | ||
call ping 127.0.0.1 -n 6 > nul | ||
|
||
echo service nginx start | ||
call sc start nginx > nul | ||
|
||
REM sleep 5 seconds | ||
call ping 127.0.0.1 -n 6 > nul | ||
|
||
call yarn e2e.test:translation:personal | ||
|
||
exit | ||
|
||
|
||
|
||
if NOT %errorlevel% == 0 ( | ||
echo Couldn't restarte Onlyoffice%%~nf service | ||
) | ||
|
||
) | ||
|
||
echo. | ||
|
||
POPD | ||
|
||
if "%1"=="nopause" goto start | ||
pause | ||
:start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
/coverage | ||
/tests/output | ||
/tests/reports | ||
/tests/screenshots/translation | ||
|
||
# production | ||
/build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
products/ASC.Files/Client/tests/helpers/cloneModelScreenshot.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
var path = require("path"); | ||
var fs = require("fs"); | ||
var async = require("async"); | ||
|
||
const config = require("../../../../../config/appsettings.json"); | ||
const cultures = config.web.cultures.split(","); | ||
|
||
function getFiles(dirPath, callback) { | ||
fs.readdir(dirPath, function (err, files) { | ||
if (err) return callback(err); | ||
|
||
var filePaths = []; | ||
async.eachSeries( | ||
files, | ||
function (fileName, eachCallback) { | ||
var filePath = path.join(dirPath, fileName); | ||
|
||
fs.stat(filePath, function (err, stat) { | ||
if (err) return eachCallback(err); | ||
|
||
if (stat.isDirectory()) { | ||
getFiles(filePath, function (err, subDirFiles) { | ||
if (err) return eachCallback(err); | ||
|
||
filePaths = filePaths.concat(subDirFiles); | ||
eachCallback(null); | ||
}); | ||
} else { | ||
if (stat.isFile() && /\.png$/.test(filePath)) { | ||
filePaths.push(filePath); | ||
} | ||
|
||
eachCallback(null); | ||
} | ||
}); | ||
}, | ||
function (err) { | ||
callback(err, filePaths); | ||
} | ||
); | ||
}); | ||
} | ||
|
||
function getClonePath(filePath, culture) { | ||
const splitFilePath = filePath.split("\\"); | ||
|
||
const splitFileName = splitFilePath[splitFilePath.length - 1].split("-"); | ||
|
||
splitFileName[0] = culture; | ||
|
||
splitFilePath[splitFilePath.length - 1] = splitFileName.join("-"); | ||
|
||
const copyPath = splitFilePath.join("\\"); | ||
|
||
return copyPath; | ||
} | ||
|
||
function copyFile(filePath) { | ||
cultures.forEach((culture) => { | ||
const copyPath = getClonePath(filePath, culture); | ||
|
||
fs.copyFile(filePath, copyPath, (err) => { | ||
if (err) console.log(err); | ||
}); | ||
}); | ||
} | ||
|
||
const pathToModels = path.resolve(__dirname, "../screenshots/translation"); | ||
|
||
function cloneModelScreenshot() { | ||
getFiles(pathToModels, function (err, files) { | ||
if (err) console.log(err); | ||
|
||
files.forEach((file) => { | ||
copyFile(file); | ||
}); | ||
}); | ||
} | ||
|
||
cloneModelScreenshot(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.