<commit_before><?php

$I = new AcceptanceTester($scenario);

if (file_exists('conf/_STATUSFILE'))
{
    $I->deleteFile('conf/_STATUSFILE');
}
if (file_exists('data/previos/css/default.css'))
{
    $I->deleteFile('data/previos/css/default.css');
    $I->deleteDir('data/previos/css');
}
if (file_exists('data/previos/en/picasso.html'))
{
    $I->deleteFile('data/previos/en/picasso.html');
}

$I->wantTo('Ensure that installation works');
$I->amOnPage('/');
$I->see('Welcome to Ximdex CMS');
$I->click('Check configuration');

$I->wait(3);
$I->click('Start installation');

$I->waitForText('Installing Database', 3);
$I->fillField('host', 'db');
$I->fillField('root_user', 'ximdex');
$I->fillField('root_pass', '<PASSWORD>');
$I->fillField('name', 'ximdex');
$I->click('Create Database');

$I->wait(30);
$I->see('Set the password for this admin user');
$I->fillField('pass', '<PASSWORD>');
$I->fillField('pass2', '<PASSWORD>');
$I->click('Save settings');

$I->wait(20);
$I->see('Installing Ximdex CMS\'s default modules');
$I->click('Install modules');

$I->waitForText('Xowl configuration (optional)', 15);
$I->click('Continue');

$I->waitForText('Installation finished!', 3);
$I->click('Get started');

$I->see('User');
$I->see('Password');
$I->fillField('user', 'ximdex');
$I->fillField('password', '<PASSWORD>');
$I->click('Sign in');

$I->waitForText('WELCOME TO XIMDEX CMS, XIMDEX!', 3);
$I->wantTo('Ensure that publish works');

open_picasso_menu($I);

$I->waitForText('Publish', 3, 'body > div.xim-actions-menu.destroy-on-click.noselect.xim-actions-menu-list');
$I->click('body > div.xim-actions-menu.destroy-on-click.noselect.xim-actions-menu-list > div.button-container-list.icon.workflow_forward');
$I->wait(3);
$I->click('#all_levels');
$I->click('Publish', '#angular-content');
$I->waitForText('State has been successfully changed', 3, '#angular-content');
$count = 0;
while (!fileExistAndIsNotEmpty('data/previos/css/default.css') && $count < 45)
{
    sleep(2);
    $count++;
}
$I->seeFileFound('default.css','data/previos/css');
while (!fileExistAndIsNotEmpty('data/previos/en/picasso.html') && $count < 45)
{
    sleep(2);
    $count++;
}
$I->seeFileFound('picasso.html','data/previos/en');

// Check HTML content from published file
$I->amOnPage('/data/previos/en/picasso.html');
$I->see('Picasso', '.header');
$I->see('Cubism', '.header');

// Expiration text
$I->amOnPage('/public_xmd');
$I->wait(3);

open_picasso_menu($I);

$I->waitForText('Expire', 3, 'body > div.xim-actions-menu.destroy-on-click.noselect.xim-actions-menu-list');
$I->click('body > div.xim-actions-menu.destroy-on-click.noselect.xim-actions-menu-list > div.button-container-list.icon.expiredoc');
$I->wait(3);
$I->click('#all_levels');
$I->click('Expire', '#angular-content');
$I->waitForText('successfully sent to expire', 3, '#angular-content');
$count = 0;
while (fileExistAndIsNotEmpty('data/previos/en/picasso.html') && $count < 45)
{
    sleep(2);
    $count++;
}
$I->dontSeeFileFound('picasso.html','data/previos/en');

// Load the XML editor
$I->amOnPage('?action=xmleditor2&method=load&nodeid=10095');
$I->wait(3);
$I->switchToIframe('kupu-editor');
$I->see('Early periods');

function reload(AcceptanceTester $I)
{
    $I->click('#angular-tree > div.ui-tabs.ui-widget.ui-widget-content.ui-corner-all.tabs-container.hbox-panel.ng-isolate-scope > div.ui-tabs.ui-widget.ui-widget-content.ui-corner-all.tabs-container > div > div.browser-view.ui-tabs-panel.ui-widget-content.ui-corner-bottom.tab-pane.ng-scope.active > div.ng-scope > xim-tree > div > div.xim-treeview-btnreload.ui-corner-all.ui-state-default.ng-binding');
}

function fileExistAndIsNotEmpty($path)
{
    return file_exists($path) && filesize($path);
}
<commit_msg>Acceptance test fix for previous folder deletion<commit_after><?php

$I = new AcceptanceTester($scenario);

if (file_exists('conf/_STATUSFILE'))
{
    $I->deleteFile('conf/_STATUSFILE');
}
if (file_exists('data/previos/css/default.css'))
{
    $I->deleteFile('data/previos/css/default.css');
    $I->deleteDir('data/previos/css');
}
if (file_exists('data/previos/en/picasso.html'))
{
    $I->deleteFile('data/previos/en/picasso.html');
}

$I->wantTo('Ensure that installation works');
$I->amOnPage('/');
$I->see('Welcome to Ximdex CMS');
$I->click('Check configuration');

$I->wait(3);
$I->click('Start installation');

$I->waitForText('Installing Database', 3);
$I->fillField('host', 'db');
$I->fillField('root_user', 'ximdex');
$I->fillField('root_pass', '<PASSWORD>');
$I->fillField('name', 'ximdex');
$I->click('Create Database');

$I->wait(30);
$I->see('Set the password for this admin user');
$I->fillField('pass', '<PASSWORD>');
$I->fillField('pass2', '<PASSWORD>');
$I->click('Save settings');

$I->wait(20);
$I->see('Installing Ximdex CMS\'s default modules');
$I->click('Install modules');

$I->waitForText('Xowl configuration (optional)', 15);
$I->click('Continue');

$I->waitForText('Installation finished!', 3);
$I->click('Get started');

$I->see('User');
$I->see('Password');
$I->fillField('user', 'ximdex');
$I->fillField('password', '<PASSWORD>');
$I->click('Sign in');

$I->waitForText('WELCOME TO XIMDEX CMS, XIMDEX!', 3);
$I->wantTo('Ensure that publish works');

open_picasso_menu($I);

$I->waitForText('Publish', 3, 'body > div.xim-actions-menu.destroy-on-click.noselect.xim-actions-menu-list');
$I->click('body > div.xim-actions-menu.destroy-on-click.noselect.xim-actions-menu-list > div.button-container-list.icon.workflow_forward');
$I->wait(3);
$I->click('#all_levels');
$I->click('Publish', '#angular-content');
$I->waitForText('State has been successfully changed', 3, '#angular-content');
$count = 0;
while (!fileExistAndIsNotEmpty('data/previos/css/default.css') && $count < 45)
{
    sleep(2);
    $count++;
}
$I->seeFileFound('default.css','data/previos/css');
while (!fileExistAndIsNotEmpty('data/previos/en/picasso.html') && $count < 45)
{
    sleep(2);
    $count++;
}
$I->seeFileFound('picasso.html','data/previos/en');

// Check HTML content from published file
$I->amOnPage('/data/previos/en/picasso.html');
$I->see('Picasso', '.header');
$I->see('Cubism', '.header');

// Expiration text
$I->amOnPage('/public_xmd');
$I->wait(3);

open_picasso_menu($I);

$I->waitForText('Expire', 3, 'body > div.xim-actions-menu.destroy-on-click.noselect.xim-actions-menu-list');
$I->click('body > div.xim-actions-menu.destroy-on-click.noselect.xim-actions-menu-list > div.button-container-list.icon.expiredoc');
$I->wait(3);
$I->click('#all_levels');
$I->click('Expire', '#angular-content');
$I->waitForText('successfully sent to expire', 3, '#angular-content');
$count = 0;
while (fileExistAndIsNotEmpty('data/previos/en/picasso.html') && $count < 45)
{
    sleep(2);
    $count++;
}
// $I->dontSeeFileFound('picasso.html','data/previos/en');
$I->dontSeeFileFound('en','data/previos');

// Load the XML editor
$I->amOnPage('?action=xmleditor2&method=load&nodeid=10095');
$I->wait(3);
$I->switchToIframe('kupu-editor');
$I->see('Early periods');

function reload(AcceptanceTester $I)
{
    $I->click('#angular-tree > div.ui-tabs.ui-widget.ui-widget-content.ui-corner-all.tabs-container.hbox-panel.ng-isolate-scope > div.ui-tabs.ui-widget.ui-widget-content.ui-corner-all.tabs-container > div > div.browser-view.ui-tabs-panel.ui-widget-content.ui-corner-bottom.tab-pane.ng-scope.active > div.ng-scope > xim-tree > div > div.xim-treeview-btnreload.ui-corner-all.ui-state-default.ng-binding');
}

function fileExistAndIsNotEmpty($path)
{
    return file_exists($path) && filesize($path);
}

{'fraction_non_alphanumeric': 0.23404537614435453, 'fraction_numerical': 0.009552872495687939, 'mean_word_length': 5.884018264840183, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 160, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4604735', 'n_tokens_mistral': 2891, 'n_tokens_neox': 2811, 'n_words': 395}