Skip to content

Commit

Permalink
ci: Partition Table Editor
Browse files Browse the repository at this point in the history
  • Loading branch information
AndriiFilippov committed Jul 1, 2024
1 parent 1a98b2a commit f64ad58
Showing 1 changed file with 92 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/*******************************************************************************
* Copyright 2021 Espressif Systems (Shanghai) PTE LTD. All rights reserved.
* Use is subject to license terms.
*******************************************************************************/
package com.espressif.idf.ui.test.executable.cases.project;

import java.io.IOException;

import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
import org.junit.After;
import org.junit.BeforeClass;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.MethodSorters;

import com.espressif.idf.ui.test.common.WorkBenchSWTBot;
import com.espressif.idf.ui.test.common.utility.TestWidgetWaitUtility;
import com.espressif.idf.ui.test.operations.EnvSetupOperations;
import com.espressif.idf.ui.test.operations.ProjectTestOperations;

/**
* Test class to test the SBOM feature
*
* @author Andrii Filippov
*
*/
@SuppressWarnings("restriction")
@RunWith(SWTBotJunit4ClassRunner.class)
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class NewEspressifIDFProjectPartitionTableEditorTest
{
@BeforeClass
public static void beforeTestClass() throws Exception
{
Fixture.loadEnv();
}

@After
public void afterEachTest()
{
Fixture.cleanTestEnv();
}

@Test

private static class Fixture
{
private static SWTWorkbenchBot bot;
private static String category;
private static String subCategory;
private static String projectName;

private static void loadEnv() throws Exception
{
bot = WorkBenchSWTBot.getBot();
EnvSetupOperations.setupEspressifEnv(bot);
bot.sleep(1000);
}

private static void givenNewEspressifIDFProjectIsSelected(String category, String subCategory)
{
Fixture.category = category;
Fixture.subCategory = subCategory;
}

private static void givenProjectNameIs(String projectName)
{
Fixture.projectName = projectName;
}

private static void whenNewProjectIsSelected() throws Exception
{
ProjectTestOperations.setupProject(projectName, category, subCategory, bot);
}

private static void whenProjectIsBuiltUsingContextMenu() throws IOException
{
ProjectTestOperations.buildProjectUsingContextMenu(projectName, bot);
ProjectTestOperations.waitForProjectBuild(bot);
TestWidgetWaitUtility.waitForOperationsInProgressToFinishAsync(bot);
}

private static void cleanTestEnv()
{
TestWidgetWaitUtility.waitForOperationsInProgressToFinishAsync(bot);
ProjectTestOperations.closeAllProjects(bot);
ProjectTestOperations.deleteAllProjects(bot);
}
}
}

0 comments on commit f64ad58

Please sign in to comment.